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

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |16.3
          Component|tree-optimization           |ipa

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Josef Melcr from comment #1)
> ipa-cp later propagates 0 into a.x. Since a$x_8 is never assigned again,
> hence the body gets folded to return 0

I think IPA CP is at fault though.  Tail recusion could in theory remove the
const from the argument but then you have a mismatched from the function type
and the argument.

I am not sure a const means anything here really.  If tailr stops the tail
recusion, then there is a missed optimization.  So I think it is ipa-cp which
should ignore the const part of the arguments.  But that might cause missed
optimizations too ...

Reply via email to