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

--- Comment #5 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Also there is a missing copy prop inside sccopy.

Though I don't know if sccopy is supposed to handle when edges become
unexecutabled.

So before sccopy we have:
bb3:
  w_94 = 2;
  w.2_9 = w_94;
  if (w.2_9 != 2)
    goto <bb 4>; [41.79%] // never executed
  else
    goto <bb 6>; [58.21%] // always executed
bb4:
  if (w.2_9 != 0)
    goto <bb 7>; [5.50%] // unreachable
  else
    goto <bb 5>; [94.50%]
bb5:
  w_62 = 0;
  w.3_10 = w_62;
  if (w.3_10 != 0)
    goto <bb 7>; [5.50%] // unreachable
  else
    goto <bb 5>; [94.50%]
...
bb6:
  if (l.5_13 == 0)
    goto <bb 7>; [50.00%] //
  else
    goto <bb 3>; [50.00%] // loop back

bb7:
  # ak_14 = PHI <&MEM <intD.6 *> [(voidD.54 *)&xD.3123 + 16B](5), &xD.3123(6),
&MEM <intD.6 *> [(voidD.54 *)&xD.3123 + 16B](4)>
  # .MEM_68 = PHI <.MEM_15(5), .MEM_65(6), .MEM_65(4)>
```

Then ak_14 becomes just &xD.3123 as bb7 is only reachable via bb6.

the ccp before sccopy does not do it since it is only after ccp w is turned
into a ssa name:
No longer having address taken: w
Now a gimple register: w

Reply via email to