[Bug rtl-optimization/67449] Branch elimination problem on x86

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Aug 14 07:56:32 GMT 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|trivial                     |enhancement
   Target Milestone|---                         |9.0
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fully fixed in GCC 9+:
  <bb 4> [local count: 325343774]:
  # p_10 = PHI <&a(3), _9(4)>
  _1 = MEM[base: p_10, offset: 0B];
  __builtin_printf ("element = %d\n", _1);
  _9 = p_10 + 4;
  if (_9 == &MEM[(void *)&a + 40B])
    goto <bb 5>; [30.00%]
  else
    goto <bb 4>; [70.00%]




evrp is able to remove the == NULL check


GCC 8:

Intersecting
  ~[0B, 0B]  EQUIVALENCES: { p_22 } (1 elements)
and
  [&a, -1B]
to
  [&a, -1B]  EQUIVALENCES: { p_22 } (1 elements)

It was a combo of r9-2617 and r9-4666 which fixed this as expected.


More information about the Gcc-bugs mailing list