[backport gcc-4.7/trunk r181476, reportedly fixes PR47258, and may be a prerequisited for fixing PR39976 ] Subject: [PATCH] Mark back edges in insert_backedge_copies From: "William J dot Schmidt" Date: Thu, 17 Nov 2011 15:55:13 -0600 List-Archive: Greetings, While investigating http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39976, I found that tree-outof-ssa.c:insert_backedge_copies tests whether edges are back edges, but the back edges haven't been marked to facilitate this. (This was the reason the failures started happening in r149206, although fixing it doesn't take care of the problem in the current trunk revision because of the duplicate PHIs noted in the issue.) This simple patch updates the back edge information where it's needed. Bootstrapped and regression tested on powerpc64-linux. OK for trunk? Thanks, Bill gcc/ 2011-11-18 Bill Schmidt * tree-outof-ssa.c (insert_back_edge_copies): Add call to mark_dfs_back_edges. --- gcc-4.6.2/gcc/tree-outof-ssa.c.~1~ 2010-11-30 12:41:24.000000000 +0100 +++ gcc-4.6.2/gcc/tree-outof-ssa.c 2011-12-26 23:42:15.000000000 +0100 @@ -1021,6 +1021,8 @@ insert_backedge_copies (void) basic_block bb; gimple_stmt_iterator gsi; + mark_dfs_back_edges (); + FOR_EACH_BB (bb) { /* Mark block as possibly needing calculation of UIDs. */