aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-10-16 13:14:34 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-10-16 13:14:34 +0000
commitbd8c998f35b97b8b855ed9bbe09ed03b237c953c (patch)
treef9185be4c5f47e914f4a4470e7ebd7f58c9b2e33
parent71c92d177874fee7e5da738a30523edb83cf29c9 (diff)
downloadgcc-bd8c998f35b97b8b855ed9bbe09ed03b237c953c.zip
gcc-bd8c998f35b97b8b855ed9bbe09ed03b237c953c.tar.gz
gcc-bd8c998f35b97b8b855ed9bbe09ed03b237c953c.tar.bz2
re PR rtl-optimization/50615 (ICE: in distribute_notes, at combine.c:13282 with -O --param max-cse-insns=1)
PR rtl-optimization/50615 * combine.c (distribute_notes) <REG_ARGS_SIZE>: Skip if I3 is a no-op. From-SVN: r180058
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/combine.c15
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/vla-23.c17
4 files changed, 34 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8c5017d..766f12d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/combine.c b/gcc/combine.c
index 6c3b17c..2941114 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -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:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 653453a..d10e82b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..47be412
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vla-23.c
@@ -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;
+ }
+}