[Bug tree-optimization/99739] [11 Regression] missing optimization of a repeated conditional

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 24 09:13:20 GMT 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Whether we handle this or not at -O1 is quite dependent on short-circuiting
anyway - we only have jump threading at our hands at -O1 (we could consider
enabling non-iterating EVRP).

So I'm not sure this is an important regression.  At -O2 we end up with

  <bb 2> [local count: 1073741824]:
  _7 = i_2(D) != 0;
  _8 = j_3(D) != 0;
  _9 = _7 & _8;
  if (_9 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870911]:
  _23 = k_4(D) != 0;
  _24 = _7 & _23;
  _11 = _8 & _24;
  if (_11 != 0)
    goto <bb 4>; [94.27%]
  else
    goto <bb 5>; [5.73%]

  <bb 4> [count: 0]:
  __builtin_abort ();

  <bb 5> [local count: 1073741824]:
  return;

where reassociation leaves redundant _9 on the plate.


More information about the Gcc-bugs mailing list