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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.0, 9.3.0
            Summary|[9 regression]              |[9/10 regression]
                   |-Warray-bounds false        |-Warray-bounds false
                   |positive with -O2           |positive with -O2
      Known to work|                            |8.4.0

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
In the original testcase I clearly see some missed optimizations, notably
the failure to "thread"

  if (_12 > 6)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870913]:

  <bb 4> [local count: 1073741824]:
  # iftmp.2_13 = PHI <0(3), 1(2)>
  _14 = (_Bool) iftmp.2_13;
  if (_14 != 0)
    goto <bb 5>; [90.00%]
  else
    goto <bb 6>; [10.00%]

and as you say simplification of a pointer comparison

  _6 = &c + _2;
  _11 = _6 - &c;
  _12 = (long unsigned int) _11;
  if (_12 > 6)

we're doing the simplification only late because forwprop depends on FRE
and FRE doesn't apply match.pd rules unrestricted like forwprop does.
Not doing any DCE before VRP probably doesn't help either (DCE
would have removed the offending statement).

Reply via email to