From: Bernd Schmidt Date: Fri, 22 Jan 2016 14:49:22 +0000 (+0000) Subject: Backport PR63681 fix X-Git-Tag: releases/gcc-4.9.4~381 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21103cdd41f12262a8e6c45013c0cc9bb58bfc75;p=thirdparty%2Fgcc.git Backport PR63681 fix PR target/63681 * cfgrtl.c (cfg_layout_initialize): Weaken assert to only trigger if flag_reorder_blocks_and_partition. * hw-doloop.c (reorg_loops): Avoid reordering if that flag is set. From-SVN: r232730 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index caa7046dcf4f..3d91fa3b436f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-01-22 Bernd Schmidt + + PR target/63681 + * cfgrtl.c (cfg_layout_initialize): Weaken assert to only trigger if + flag_reorder_blocks_and_partition. + * hw-doloop.c (reorg_loops): Avoid reordering if that flag is set. + 2016-01-21 Andreas Krebbel Backported from mainline diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index f0e31671b8d0..35e535711a3e 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -4239,14 +4239,14 @@ cfg_layout_initialize (unsigned int flags) rtx x; basic_block bb; - /* Once bb reordering is complete, cfg layout mode should not be re-entered. - Entering cfg layout mode will perform optimizations on the cfg that - could affect the bb layout negatively or even require fixups. An - example of the latter is if edge forwarding performed when optimizing - the cfg layout required moving a block from the hot to the cold section - under -freorder-blocks-and-partition. This would create an illegal - partitioning unless some manual fixup was performed. */ - gcc_assert (!crtl->bb_reorder_complete); + /* Once bb partitioning is complete, cfg layout mode should not be + re-entered. Entering cfg layout mode may require fixups. As an + example, if edge forwarding performed when optimizing the cfg + layout required moving a block from the hot to the cold + section. This would create an illegal partitioning unless some + manual fixup was performed. */ + gcc_assert (!(crtl->bb_reorder_complete + && flag_reorder_blocks_and_partition)); initialize_original_copy_tables (); diff --git a/gcc/hw-doloop.c b/gcc/hw-doloop.c index cc8f9b775052..d18276103b4a 100644 --- a/gcc/hw-doloop.c +++ b/gcc/hw-doloop.c @@ -636,7 +636,9 @@ reorg_loops (bool do_reorder, struct hw_doloop_hooks *hooks) loops = discover_loops (&loop_stack, hooks); - if (do_reorder) + /* We can't enter cfglayout mode anymore if basic block partitioning + already happened. */ + if (do_reorder && !flag_reorder_blocks_and_partition) { reorder_loops (loops); free_loops (loops);