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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
           Keywords|                            |missed-optimization
     Ever confirmed|0                           |1
                 CC|                            |aldyh at gcc dot gnu.org
   Last reconfirmed|                            |2021-10-22
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
There's identical IL before the vrp2 pass (the one after strlen) but on the GCC
11 branch vrp2 eliminates the call to foo while on trunk it does not.

On the branch VRP registers

  Registering jump thread: (2, 3) incoming edge;  (3, 4) normal;

which elides the call but vrp-thread2 does not do this:

 Registering value_relation (_5 > a.4_4) (bb5) at _5 = a.4_4 + 1;
 Registering value_relation (_19 > a.4_13) (bb4) at _19 = a.4_13 + 1;
  [4] Registering jump thread: (2, 3) incoming edge;  (3, 4) normal;
Failure in thread_through_loop_header:   Cancelling jump thread: (2, 3)
incoming edge;  (3, 4) normal;

on the branch this threading destroys the loop structure

Reply via email to