From patchwork Tue Sep 11 12:25:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: shrink-wrapping duplicates BBs across partitions. Date: Tue, 11 Sep 2012 02:25:12 -0000 From: Christian Bruel X-Patchwork-Id: 183087 Message-Id: <504F2DA8.3050208@st.com> To: "gcc-patches@gcc.gnu.org" Hello, While testing the patch to enable shrink-wrapping on SH [PR54546], we hit an the "error: EDGE_CROSSING missing across section boundary" Indeed, shrink-wrap duplicates a bb with successors (containing the return sequence) into an unlikely section. I first thought about setting the EDGE_CROSSING on flag on those edge, but I feel that this block duplication doesn't go in the direction of this optimization. Not duplicating BBs between partitions solves the problem. Does this restriction look right to you ? (regression tests are still running on x86 and sh) Thanks a lot for any comment. Christian Index: function.c =================================================================== --- function.c (revision 191177) +++ function.c (working copy) @@ -6063,6 +6063,7 @@ FOR_EACH_EDGE (e, ei, tmp_bb->preds) if (single_succ_p (e->src) && !bitmap_bit_p (&bb_on_list, e->src->index) + && (BB_PARTITION (e->src) == BB_PARTITION (e->dest)) && can_duplicate_block_p (e->src)) { edge pe;