summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-02 12:35:38 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-02 12:35:38 +0000
commit20e67c9a76abdff9aef2729f98d215045cf6e3c8 (patch)
tree229fd5eb9a30eb3318898dfa3eb311a1d050bbe8
parent02be515c2b183a3981a4146e5a0b4c0ec1c9ceb3 (diff)
downloadgcc-20e67c9a76abdff9aef2729f98d215045cf6e3c8.tar.gz
2008-01-02 Richard Guenther <rguenther@suse.de>
PR middle-end/34093 PR middle-end/31976 * tree-ssa-operands.c (ssa_operand_alloc): Also allocate a buffer for very large number of operands instead of ICEing. * gcc.c-torture/compile/pr34093.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131257 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr34093.c39
-rw-r--r--gcc/tree-ssa-operands.c9
4 files changed, 56 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1524eac7442..490dc74140c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-02 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/34093
+ PR middle-end/31976
+ * tree-ssa-operands.c (ssa_operand_alloc): Also allocate a buffer
+ for very large number of operands instead of ICEing.
+
2008-01-02 Arthur Norman <acn1@cam.ac.uk>
PR 34013
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f8ea8d2fc2c..b16a2b16940 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-02 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/34093
+ PR middle-end/31976
+ * gcc.c-torture/compile/pr34093.c: New testcase.
+
2008-01-01 Douglas Gregor <doug.gregor@gmail.com>
* g++.dg/cpp0x/long_long.C: New.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34093.c b/gcc/testsuite/gcc.c-torture/compile/pr34093.c
new file mode 100644
index 00000000000..4f6934380d9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr34093.c
@@ -0,0 +1,39 @@
+struct X { int i; int j; };
+#define FOO struct X
+#define FOO10(x) FOO x ## 0; FOO x ## 1; FOO x ## 2; FOO x ## 3; FOO x ## 4; FOO x ## 5; FOO x ## 6; FOO x ## 7; FOO x ## 8; FOO x ## 9;
+#define FOO100(x) FOO10(x ## 0) FOO10(x ## 1) FOO10(x ## 2) FOO10(x ## 3) FOO10(x ## 4) FOO10(x ## 5) FOO10(x ## 6) FOO10(x ## 7) FOO10(x ## 8) FOO10(x ## 9)
+ FOO100(x0)
+ FOO100(x1)
+ FOO100(x2)
+ FOO100(x3)
+ FOO100(x4)
+ FOO100(x5)
+ FOO100(x6)
+ FOO100(x7)
+ FOO100(x8)
+ FOO100(x9)
+
+#define COO(n,f) case n: p = &f; break;
+#define COO10(n,f) COO(n ## 0, f ## 0) COO(n ## 1, f ## 1) COO(n ## 2, f ## 2) COO(n ## 3, f ## 3) COO(n ## 4, f ## 4) COO(n ## 5, f ## 5) COO(n ## 6, f ## 6) COO(n ## 7, f ## 7) COO(n ## 8, f ## 8) COO(n ## 9, f ## 9)
+#define COO100(n,f) COO10(n ## 0, f ## 0) COO10(n ## 1, f ## 1) COO10(n ## 2, f ## 2) COO10(n ## 3, f ## 3) COO10(n ## 4, f ## 4) COO10(n ## 5, f ## 5) COO10(n ## 6, f ## 6) COO10(n ## 7, f ## 7) COO10(n ## 8, f ## 8) COO10(n ## 9, f ## 9)
+
+int foo(int i)
+{
+ struct X *p = 0;
+ x000.i = 0;
+ x599.j = 0;
+ switch (i)
+ {
+ COO100(1, x0)
+ COO100(2, x1)
+ COO100(3, x2)
+ COO100(4, x3)
+ COO100(5, x4)
+ COO100(6, x5)
+ COO100(7, x6)
+ COO100(8, x7)
+ COO100(9, x8)
+ COO100(10, x9)
+ }
+ return p->j;
+}
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 72f44338b2d..116877d77bb 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -477,11 +477,10 @@ ssa_operand_alloc (unsigned size)
gimple_ssa_operands (cfun)->ssa_operand_mem_size
= OP_SIZE_3 * sizeof (struct voptype_d);
- /* Fail if there is not enough space. If there are this many operands
- required, first make sure there isn't a different problem causing this
- many operands. If the decision is that this is OK, then we can
- specially allocate a buffer just for this request. */
- gcc_assert (size <= gimple_ssa_operands (cfun)->ssa_operand_mem_size);
+ /* We can reliably trigger the case that we need arbitrary many
+ operands (see PR34093), so allocate a buffer just for this request. */
+ if (size > gimple_ssa_operands (cfun)->ssa_operand_mem_size)
+ gimple_ssa_operands (cfun)->ssa_operand_mem_size = size;
ptr = (struct ssa_operand_memory_d *)
ggc_alloc (sizeof (struct ssa_operand_memory_d)