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

--- Comment #3 from Filip Kastl <pheeck at gcc dot gnu.org> ---
>From the transformations that sccopy1 does, this one causes the problem:


 ;; Function main (main, funcdef_no=3, decl_uid=2989, cgraph_uid=5,
symbol_order=4)

+Replacing SCC of size 3
 int main ()
 {
   int r;
@@ -245,20 +246,19 @@
   <bb 3> :
   # l_27 = PHI <8(2), o_29(5)>
   # o_28 = PHI <0(2), o_29(5)>
-  # .MEM_32 = PHI <.MEM_42(D)(2), .MEM_33(5)>
 v:
   _2 = 1 / l_27;
   r_43 = _2 + -805306366;
-  # VUSE <.MEM_32>
+  # VUSE <.MEM_42(D)>
   _4 = j (-3, 30, -4, -4, -4, -4, -4, 32, -4);
   _5 = _4 + -445113689;
   _6 = _5 - r_43;
-  # VUSE <.MEM_32>
+  # VUSE <.MEM_42(D)>
   _7 = j (-2, 23, -3, -3, -3, -3, -3, 22, -3);
   _8 = _7 + -1062535215;
   _9 = _8 * 2147483647;
   _10 = _6 + _9;
-  # VUSE <.MEM_32>
+  # VUSE <.MEM_42(D)>
   _11 = j (-1, 1, -2, -2, -2, -2, -2, 1, -2);
   _12 = _11 + -950633090;
   _13 = _12 * -1342177282;
@@ -275,14 +275,12 @@

   <bb 5> :
   # o_29 = PHI <o_28(3), o_51(7)>
-  # .MEM_33 = PHI <.MEM_32(3), .MEM_34(7)>
   // predicted unlikely by goto predictor.
   goto <bb 3>; [INV]

   <bb 6> :
   # o_30 = PHI <o_28(4), o_51(7)>
   # r_31 = PHI <r_43(4), r_48(7)>
-  # .MEM_34 = PHI <.MEM_32(4), .MEM_34(7)>
 w:
   r_48 = r_31 + 536870911;
   _24 = _7 + -1062535222;
@@ -303,7 +301,7 @@
     goto <bb 6>; [INV]

   <bb 8> :
-  # VUSE <.MEM_34>
+  # VUSE <.MEM_42(D)>
   return 0;

 }


All the removed PHIs (.MEM_32, .MEM_33, .MEM_34) just reference each other. 
That's the situation the pass was made for.  For normal PHIs, this cleanup is
ok.  Is it not ok for memory PHIs?

Reply via email to