]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/50615 (ICE: in distribute_notes, at combine.c:13282 with ...
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 16 Oct 2011 13:14:34 +0000 (13:14 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 16 Oct 2011 13:14:34 +0000 (13:14 +0000)
PR rtl-optimization/50615
* combine.c (distribute_notes) <REG_ARGS_SIZE>: Skip if I3 is a no-op.

From-SVN: r180058

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vla-23.c [new file with mode: 0644]

index 8c5017d95fd222fa6b20dde2995aac1d80eb8a94..766f12d56d789969f9569335feee066cae11330b 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR rtl-optimization/50615
+       * combine.c (distribute_notes) <REG_ARGS_SIZE>: Skip if I3 is a no-op.
+
 2011-10-16  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/50596
index 6c3b17ca6ea40346f4d7294d9d0de8360d339fd7..29411149173b1fdf91d42b89edd62c00300a3374 100644 (file)
@@ -13274,13 +13274,14 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2, rtx elim_i2,
          break;
 
        case REG_ARGS_SIZE:
-         {
-           /* ??? How to distribute between i3-i1.  Assume i3 contains the
-              entire adjustment.  Assert i3 contains at least some adjust.  */
-           int old_size, args_size = INTVAL (XEXP (note, 0));
-           old_size = fixup_args_size_notes (PREV_INSN (i3), i3, args_size);
-           gcc_assert (old_size != args_size);
-         }
+         /* ??? How to distribute between i3-i1.  Assume i3 contains the
+            entire adjustment.  Assert i3 contains at least some adjust.  */
+         if (!noop_move_p (i3))
+           {
+             int old_size, args_size = INTVAL (XEXP (note, 0));
+             old_size = fixup_args_size_notes (PREV_INSN (i3), i3, args_size);
+             gcc_assert (old_size != args_size);
+           }
          break;
 
        case REG_NORETURN:
index 653453a77ed601610a7acacb1cd77b2987eee1d4..d10e82b3ee11bb576a93c4a6e604412dfc85ff18 100644 (file)
@@ -1,3 +1,7 @@
+2011-10-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc.dg/vla-23.c: New test.
+
 2011-10-16  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/50596
diff --git a/gcc/testsuite/gcc.dg/vla-23.c b/gcc/testsuite/gcc.dg/vla-23.c
new file mode 100644 (file)
index 0000000..47be412
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/50615 */
+/* Testcase by Zdenek Sojka <zsojka@seznam.cz> */
+
+/* { dg-do compile } */
+/* { dg-options "-O --param max-cse-insns=1" } */
+
+int
+foo (int a)
+{
+  if (!a)
+    return 1;
+
+  {
+    int s[a];
+    return 0;
+  }
+}