https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118430

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'm really surprised we used to tail call it at all in the #c6 testcase at all,
must be some IPA optimization which proves that non_tail_call does not do say
*ptr = 42; p = ptr; for some global int *p; and tail_call2 then say not
checking if *p == 42 or similar, because then it can't be tail called.  If
noipa is used on them, then we don't tail call for that very reason
(correctly).
So, using musttail with val still in scope is a bad idea, you rely on
inter-procedural optimizations figuring that out, better put val in a new {}
scope and end that before the musttail call like in #c1.

That said, I'm afraid it is really hard to avoid the folding of uses of
singleton ranges into constants, so perhaps better might be to check for this
in the tailc pass and still keep there the constant in return, and then handle
it right during expansion.

Reply via email to