]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport PR63681 fix
authorBernd Schmidt <bernds@redhat.com>
Fri, 22 Jan 2016 14:49:22 +0000 (14:49 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Fri, 22 Jan 2016 14:49:22 +0000 (14:49 +0000)
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

gcc/ChangeLog
gcc/cfgrtl.c
gcc/hw-doloop.c

index caa7046dcf4f413322493f6ad887b1a718e5f281..3d91fa3b436f7228d9185383e1d7d4559f20105d 100644 (file)
@@ -1,3 +1,10 @@
+2016-01-22  Bernd Schmidt <bschmidt@redhat.com>
+
+       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  <krebbel@linux.vnet.ibm.com>
 
        Backported from mainline
index f0e31671b8d0d864df8fda3aec4f8c806d200108..35e535711a3e50f7f882c9a6671e523bf7a5ce72 100644 (file)
@@ -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 ();
 
index cc8f9b77505227ba21c67d42b371aa7f925804a9..d18276103b4a67fcc83ce986fcd7b2e6bcc1d3f2 100644 (file)
@@ -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);