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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |tree-optimization

--- Comment #20 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So I am not sure if the best place to resolve this is cse. The problem is
really ivopts which causes the overlapping live ranges to show up.


````
  <bb 3> [local count: 1014686025]:
  # ivtmp.7_17 = PHI <ivtmp.7_6(7), ivtmp.7_20(6)>
  _3 = (int *) ivtmp.7_17;
  _21 = (void *) ivtmp.7_17;
  _4 = MEM[(int *)_21];
  if (_4 == val_13)
    goto <bb 9>; [5.50%] // exit
  else
    goto <bb 4>; [94.50%]

  <bb 9> [local count: 55807731]:
  # _19 = PHI <_3(3)>
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 958878295]:
  ivtmp.7_6 = ivtmp.7_17 + 4;
  if (ivtmp.7_6 != _25)
    goto <bb 7>; [94.50%]
  else
    goto <bb 12>; [5.50%] // exit

  <bb 12> [local count: 52738306]:
  goto <bb 8>; [100.00%]

  <bb 7> [local count: 906139989]:
  goto <bb 3>; [100.00%]
```

Notice how _3 (which is also _21 later on) and ivtmp.7_17 are alive at the same
time [though they are the same value].
(this is what got "fixed" up by cse2 before and is not currently).

The big question is how to fix this in IV-OPTs. Using  the pointer type for the
IV might cause an overflow but maybe that would be undefined in the beginning.

Reply via email to