OSDN Git Service

PR bootstrap/42347
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 May 2010 17:19:46 +0000 (17:19 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 May 2010 17:19:46 +0000 (17:19 +0000)
* cfglayout.c (fixup_reorder_chain): Allow returnjump_p
to have no fallthru edge.

* gcc.c-torture/compile/pr42347.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159496 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cfglayout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr42347.c [new file with mode: 0644]

index eeb5110..87f27e7 100644 (file)
@@ -1,5 +1,9 @@
 2010-05-17  Jakub Jelinek  <jakub@redhat.com>
 
+       PR bootstrap/42347
+       * cfglayout.c (fixup_reorder_chain): Allow returnjump_p
+       to have no fallthru edge.
+
        PR middle-end/44102
        * cfgcleanup.c (try_optimize_cfg): When removing trivially empty
        bb with no successors, move footer whenever in IR_RTL_CFGLAYOUT
index 7ba289f..5e12057 100644 (file)
@@ -793,7 +793,8 @@ fixup_reorder_chain (void)
                 to prevent rtl_verify_flow_info from complaining.  */
              if (!e_fall)
                {
-                 gcc_assert (!onlyjump_p (bb_end_insn));
+                 gcc_assert (!onlyjump_p (bb_end_insn)
+                             || returnjump_p (bb_end_insn));
                  bb->il.rtl->footer = emit_barrier_after (bb_end_insn);
                  continue;
                }
index dfe8de7..fcc6968 100644 (file)
@@ -1,5 +1,8 @@
 2010-05-17  Jakub Jelinek  <jakub@redhat.com>
 
+       PR bootstrap/42347
+       * gcc.c-torture/compile/pr42347.c: New test.
+
        PR middle-end/44102
        * g++.dg/ext/asmgoto1.C: New test.
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr42347.c b/gcc/testsuite/gcc.c-torture/compile/pr42347.c
new file mode 100644 (file)
index 0000000..e98b869
--- /dev/null
@@ -0,0 +1,16 @@
+/* PR bootstrap/42347 */
+
+long
+foo (long x, long y)
+{
+  x = x & y;
+  switch (y)
+    {
+    case 63L: x >>= 0; break;
+    case 4032L: x >>= 6; break;
+    case 258048L: x >>= 12; break;
+    case 16515072L: x >>= 18; break;
+    default: __builtin_unreachable ();
+    }
+  return x;
+}