This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/13175] ICE in eliminate_extraneous_phis, at tree-ssa.c:1720


------- Additional Comments From amacleod at redhat dot com  2003-11-24 17:35 -------
Interesting.  This is triggered by new code which is looking for error conditions.

Whats happening is that DCE2 eliminates dead code, and leaves the sequence:
  # iftmp.1435_13 = PHI <4(6), iftmp.1435_132(7)>;
<L21>:;
  if (iftmp.1435_13 == 0) goto <L24>; else goto <L28>;

<L23>:;
  <...irrelevant code...> 

<L24>:;
<L25>:;
  goto <L28>;

<L28>:;
 
cleanup_cfg() then runs, decides the comparision
   iftmp.1435_13 == 0
is not required, so it fold the condition into a GOTO <L28>

That mens the PHI node is no longer needed, so it is in effect dead code.

SSA->Normal assumes/verifies that all the dead PHI results are gone, so it saves
time by not looking in all the PHI nodes for relevant variables that need to be
un-ssa-ified.   

The new checking code found we were about to eliminate this PHI node as
irrelevent since there are no uses of the PHI. 

Im not sure of the best way of handling this. Diego said he was about to (or
already did?) make virtual PHIs distinguishable from regular PHIs. If thats the
case, then we can process just the regular PHIs in the SSA->Normal pass, and
eliminate this problem that way. The original speed optimization was present to
 avoid wasting lots of time processing virtual PHI nodes.

Of course, with no uses, we're a lot better off deleting the PHI node anyway...

I'll think about it a bit.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13175


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]