------- Additional Comments From steven at gcc dot gnu dot org 2004-12-24 12:52 ------- Silly bugzilla... Sorry about that.
A piece of unidiff, then. (-) is the smaller test that works, (+) is the test where we get the extra copy. What I wanted to show is that only the root variable is different in the PHI argument: @@ -28,10 +29,10 @@ # BLOCK 1 # PRED: 0 [100.0%] (fallthru,exec) 1 [89.0%] (dfs_back,false,exec) - # temp2D.1464_1 = PHI <temp2D.1464_2(0), temp2D.1464_4(1)>; + # temp2D.1464_1 = PHI <temp2D.1464_2(0), temp1D.1468_4(1)>; <L0>:; - temp2D.1464_4 = temp2D.1464_1 * xlvj_D.1465_3; - if (temp2D.1464_4 != 0) goto <L2>; else goto <L0>; + temp1D.1468_4 = temp2D.1464_1 * xlvj_D.1465_3; + if (temp1D.1468_4 != 0) goto <L2>; else goto <L0>; # SUCC: 2 [11.0%] (loop_exit,true,exec) 1 [89.0%] (dfs_back,false,exec) # BLOCK 2 @@ -48,45 +49,45 @@ This comes from DOM copy-proping around the loop. Before DOM1 we have a function that looks like this (.dce1): ;; Function f (f) f (temp2, xlvj_) { int temp1; int D.1471; # temp2_1 = PHI <temp2_2(-1), temp2_5(0)>; <L0>:; temp1_4 = temp2_1 * xlvj__3; temp2_5 = temp1_4; if (temp1_4 != 0) goto <L2>; else goto <L0>; <L2>:; xlvj__6 = xlvj__3; return xlvj__6; } After DOM1 (the .dom1 dump) we have this: ;; Function f (f) f (temp2, xlvj_) { int temp1; int D.1471; # temp2_1 = PHI <temp2_2(-1), temp1_4(0)>; <L0>:; temp1_4 = temp2_1 * xlvj__3; temp2_5 = temp1_4; if (temp1_4 != 0) goto <L2>; else goto <L0>; <L2>:; xlvj__6 = xlvj__3; return xlvj__3; } We never recover from this, we don't coalesce, and there's your copy. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19038