]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/54920 (segfault in tree-ssa-pre.c during Firefox build)
authorRichard Guenther <rguenther@suse.de>
Mon, 15 Oct 2012 11:22:49 +0000 (11:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 15 Oct 2012 11:22:49 +0000 (11:22 +0000)
2012-10-15  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/54920
* tree-ssa-pre.c (create_expression_by_pieces): Properly
allocate temporary storage for all NARY elements.

* gcc.dg/torture/pr54920.c: New testcase.

From-SVN: r192454

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr54920.c [new file with mode: 0644]
gcc/tree-ssa-pre.c

index 790c69e485c68dfa756185374af7c2c3fd49b724..7447694b610858ac75f744781f0d3e49f89c0305 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/54920
+       * tree-ssa-pre.c (create_expression_by_pieces): Properly
+       allocate temporary storage for all NARY elements.
+
 2012-10-15  Joern Rennecke  <joern.rennecke@embecosm.com>
 
        * web.c (union_match_dups): Properly handle OP_INOUT match_dups.
index 23f8c2e0dd4cd3276af5426d154fc41482be8827..07a052da7290c2b48025bc215cd1c5bc6f05e164 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/54920
+       * gcc.dg/torture/pr54920.c: New testcase.
+
 2012-10-15  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/unchecked_convert9.ad[sb]: New test.
diff --git a/gcc/testsuite/gcc.dg/torture/pr54920.c b/gcc/testsuite/gcc.dg/torture/pr54920.c
new file mode 100644 (file)
index 0000000..d1622f7
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+typedef short __v8hi __attribute__ ((__vector_size__ (16)));
+typedef long long __m128i __attribute__ ((__vector_size__ (16)));
+int a;
+__m128i b;
+
+void
+fn1 ()
+{
+  while (1)
+    b = (__m128i) (__v8hi) { a, 0, 0, 0, 0, 0 };
+}
index fe9186cefa94bcdc80ff220923eed1d90a8768c9..548c110f6d217404cf7ab60fded9ecb4bd2bd6e3 100644 (file)
@@ -2853,7 +2853,7 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
     case NARY:
       {
        vn_nary_op_t nary = PRE_EXPR_NARY (expr);
-       tree genop[4];
+       tree *genop = XALLOCAVEC (tree, nary->length);
        unsigned i;
        for (i = 0; i < nary->length; ++i)
          {