On Wed, Jan 31, 2024 at 12:16:59PM -0800, Andi Kleen wrote: > > This results in "error: cannot tail-call: cannot tail-call: other reasons". > > So the second argument should be "other reasons" only. > > Yes will fix those. Thanks. > > > > > I notice that if I don't use -O2 I also get "other reasons". But it should > > be > > easy-ish to say "cannot tail-call: optimizations not enabled" or so. > > It's unfortunately not easy to distinguish. It's not just -O2, but > various missing transformations make tree-tailcall not do it its job, > and they could depend on other flags. But there might be also other > reasons not related to the optimization that makes the tail call fall. > I would be uncomfortable reporting the problem is -O2 when it might > be something else. > > The right fix would be to make tree-tailcall not fail with optimization, > and for the remaining cases add errors there. But that would > make the patch a lot bigger and it's not clear it would improve usability > that much. So I opted to just mention the problem in the documentation.
Ah, we don't want that. I meant to check the simplest case: if (optimize < 2) ... but if it's more complicated than that then let's let it be. Thanks, Marek