[Bug tree-optimization/123020] [13/14/15/16 Regression] Equivalent ternary and if produce different loop (extra compare in g())

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Dec 6 00:21:05 GMT 2025


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.5
            Summary|[missed-optimization]       |[13/14/15/16 Regression]
                   |Equivalent ternary and if   |Equivalent ternary and if
                   |produce different loop      |produce different loop
                   |(extra compare in g())      |(extra compare in g())
      Known to fail|                            |10.1.0, 11.4.0, 9.5.0
      Known to work|                            |8.5.0

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This regressed when phiopt1 was added to the early.

ethread costing looks reasonable after all. It is just there are redundant
loads which is causing the costing to be off. and only in fre those are
removed.
I am not sure if we should move early jump threading after SRA/FRE either.


More information about the Gcc-bugs mailing list