------- Comment #6 from rguenth at gcc dot gnu dot org 2008-08-28 14:48 ------- It looks like that we correctly track liveliness by
Live on entry to BB2 : Live on entry to BB3 : a_lsm.27_5 Live on entry to BB4 : a_lsm.27_5 Live on entry to BB5 : Live on entry to BB6 : for # BLOCK 2 freq:2000 # PRED: ENTRY [100.0%] (fallthru,exec) c.0_4 = c; a_lsm.27_5 = b; a_lsm.27_1 = a; if (c.0_4 != 0) goto <bb 3>; else goto <bb 4>; # SUCC: 4 [50.0%] (false,exec) 3 [50.0%] (true,exec) # BLOCK 3 freq:1000 # PRED: 2 [50.0%] (true,exec) # SUCC: 4 [100.0%] (fallthru,exec) # BLOCK 4 freq:2000 # PRED: 3 [100.0%] (fallthru,exec) 2 [50.0%] (false,exec) # a_lsm.27_29 = PHI <a_lsm.27_5(3), a_lsm.27_1(2)> a = a_lsm.27_5; e_9 = a_lsm.27_5 << 1; if (e_9 != 0) goto <bb 5>; else goto <bb 6>; # SUCC: 5 [54.0%] (true,exec) 6 [46.0%] (false,exec) and based on this create the conflict graph. But we still (blindly) generate copies for the (dead) PHI node in BB4 which causes conflicts that we didn't see. So, why exactly do we generate copies for a PHI node which result is not live-in in its BB? Andrew - you are probably most familiar with the out-of-SSA code, can you have a look here? (the dead PHI node is caused by the last DSE pass which removes the last use of it and there is no other DCE pass to clean that up). Jakubs testcase from comment #3 at -O3. My humble "fix" for this would be to exchange 118.cddce with 120.dse which should hide this problem. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amacleod at redhat dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37102