sh.c (sh_override_options): When flag_exceptions or flag_unwind_tables is on...
authorKaz Kojima <kkojima@gcc.gnu.org>
Thu, 13 Aug 2009 22:16:07 +0000 (22:16 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Thu, 13 Aug 2009 22:16:07 +0000 (22:16 +0000)
* config/sh/sh.c (sh_override_options): When flag_exceptions or
flag_unwind_tables is on, turn flag_reorder_blocks_and_partition
off.

From-SVN: r150727

gcc/ChangeLog
gcc/config/sh/sh.c

index 70905a8..77c52bf 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-13  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       * config/sh/sh.c (sh_override_options): When flag_exceptions or
+       flag_unwind_tables is on, turn flag_reorder_blocks_and_partition
+       off.
+
 2009-08-13  Ghassan Shobaki  <ghassan.shobaki@amd.com>
 
        * tree-ssa-loop-prefetch.c 
index b092c0e..a4be11c 100644 (file)
@@ -874,6 +874,29 @@ sh_override_options (void)
        flag_schedule_insns = 0;
     }
 
+  /* Unwinding with -freorder-blocks-and-partition does not work on this
+     architecture, because it requires far jumps to label crossing between
+     hot/cold sections which are rejected on this architecture.  */
+  if (flag_reorder_blocks_and_partition)
+    {
+      if (flag_exceptions)
+       {
+         inform (input_location, 
+                 "-freorder-blocks-and-partition does not work with "
+                 "exceptions on this architecture");
+         flag_reorder_blocks_and_partition = 0;
+         flag_reorder_blocks = 1;
+       }
+      else if (flag_unwind_tables)
+       {
+         inform (input_location,
+                 "-freorder-blocks-and-partition does not support unwind "
+                 "info on this architecture");
+         flag_reorder_blocks_and_partition = 0;
+         flag_reorder_blocks = 1;
+       }
+    }
+
   if (align_loops == 0)
     align_loops =  1 << (TARGET_SH5 ? 3 : 2);
   if (align_jumps == 0)