------- Additional Comments From steven at gcc dot gnu dot org 2004-12-24 12:42 ------- A smaller test case:
int f (int temp2, int xlvj_) { int temp1; for(;;) { temp1 = temp2*xlvj_; temp2 = temp1; if (temp1) break; } return xlvj_; } After out-of-ssa this gives the following tree dump: ;; Function f (f) Analyzing Edge Insertions. f (temp2, xlvj_) { int temp1; int D.1471; <L4>:; <L0>:; temp1 = temp2 * xlvj_; if (temp1 != 0) goto <L2>; else goto <L7>; <L7>:; temp2 = temp1; goto <bb 1> (<L0>); <L2>:; return xlvj_; } As far as I can tell the following test case is semantically equivalent to the one above: int f (int temp2, int xlvj_) { for(;;) { temp2 = temp2*xlvj_; if (temp2) break; } return xlvj_; } But the tree dumps are definitely not the same, in the smaller test case we don't have the extra copy: ;; Function f (f) Analyzing Edge Insertions. f (temp2, xlvj_) { int D.1470; <L4>:; <L0>:; temp2 = temp2 * xlvj_; if (temp2 != 0) goto <L2>; else goto <L0>; <L2>:; return xlvj_; } So apparently something is preventing temp1 and temp2 from being coalesced when going out of ssa. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19038