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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization,
                   |                            |needs-bisection
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Target Milestone|---                         |11.0
   Last reconfirmed|                            |2021-03-01

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Some forwprop/match.pd prevents phiopt to trigger:

GCC 10 (forwprop->phiopt):

   <bb 2> [local count: 1073741824]:
   _7 = (unsigned char) c_2(D);
   _8 = _7 + 208;
-  if (_8 <= 9)
-    goto <bb 3>; [50.00%]
-  else
-    goto <bb 4>; [50.00%]
-
-  <bb 3> [local count: 536870913]:
-
-  <bb 4> [local count: 1073741824]:
-  # iftmp.1_1 = PHI <1(3), 0(2)>
-  return iftmp.1_1;
+  _9 = _8 <= 9;
+  return _9;

forwprop difference GCC 10/11:

-  Replaced '_9 != 0' with '_8 <= 9'
-bar (char c)
+bool bar (char c)
 {
   bool iftmp.1_1;
-  unsigned char _7;
-  unsigned char _8;
+  unsigned char c.0_4;
+  unsigned char _5;
+  bool _6;
+  bool _7;

   <bb 2> [local count: 1073741824]:
-  _7 = (unsigned char) c_2(D);
-  _8 = _7 + 208;
-  if (_8 <= 9)
+  if (c_2(D) != 0)
     goto <bb 3>; [50.00%]
   else
     goto <bb 4>; [50.00%]

   <bb 3> [local count: 536870913]:
+  c.0_4 = (unsigned char) c_2(D);
+  _5 = c.0_4 + 208;
+  _6 = _5 <= 9;
+  _7 = -_6;

   <bb 4> [local count: 1073741824]:
-  # iftmp.1_1 = PHI <1(3), 0(2)>
+  # iftmp.1_1 = PHI <_7(3), 0(2)>
   return iftmp.1_1;

Reply via email to