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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|ipa                         |tree-optimization
           Keywords|                            |diagnostic,
                   |                            |missed-optimization
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-05-28
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  We're warning on the obviously unreachable loop since:

<bb 4> [local count: 1073741824]:
_35 = 12;
if (_35 != 12)
  goto <bb 7>; [75.00%]
else
  goto <bb 6>; [25.00%]

$3 = <basic_block 0x7ffff434b680 (4)>

since we apply final value replacement to 'i' in sccp but do not propagate it
before the next number of iteration analysis in ivcanon:

          NEXT_PASS (pass_tree_loop_init);
          NEXT_PASS (pass_tree_unswitch);
          NEXT_PASS (pass_scev_cprop);          <<<< final value repl.
          NEXT_PASS (pass_loop_split);
          NEXT_PASS (pass_loop_versioning);
          NEXT_PASS (pass_loop_jam);
          /* All unswitching, final value replacement and splitting can expose
             empty loops.  Remove them now.  */
          NEXT_PASS (pass_cd_dce, false /* update_address_taken_p */);
          NEXT_PASS (pass_iv_canon);           <<<<< warning
          NEXT_PASS (pass_loop_distribution);
          NEXT_PASS (pass_linterchange);
          NEXT_PASS (pass_copy_prop);          <<<<<< propagation

IIRC final value replacement used to propagate and fold but I(?) removed this
at some point.

Reply via email to