]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/19263 (wrong-code: explicit initialization of v8qi miscompiled)
authorJakub Jelinek <jakub@redhat.com>
Fri, 14 Jan 2005 23:51:38 +0000 (00:51 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 14 Jan 2005 23:51:38 +0000 (00:51 +0100)
PR c++/19263
* typeck2.c (split_nonconstant_init_1) <case VECTOR_TYPE>: Put a copy
of CONSTRUCTOR's node into MODIFY_EXPR, as the original is modified.
Store code to *pcode.

* g++.dg/init/vector1.C: New test.

From-SVN: r93674

gcc/cp/ChangeLog
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog

index 0d0051ea2db25bf0b8bdb07353e19f2832873c19..e31e6db6f9b728d53a44ca6a1efb6930c3640e93 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/19263
+       * typeck2.c (split_nonconstant_init_1) <case VECTOR_TYPE>: Put a copy
+       of CONSTRUCTOR's node into MODIFY_EXPR, as the original is modified.
+       Store code to *pcode.
+
 2004-12-28  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/18384, c++/18327
index f11dbe19850d7034fcdb942238b1a61ad0a9fed3..780c3e7abe4d419952160ea317c0ca92a1065e58 100644 (file)
@@ -348,9 +348,11 @@ split_nonconstant_init_1 (tree dest, tree init, tree *pcode)
     case VECTOR_TYPE:
       if (!initializer_constant_valid_p (init, type))
        {
+         tree cons = copy_node (init);
          CONSTRUCTOR_ELTS (init) = NULL;
-         code = build (MODIFY_EXPR, type, dest, init);
+         code = build (MODIFY_EXPR, type, dest, cons);
          code = build_stmt (EXPR_STMT, code);
+         *pcode = code;
          pcode = &TREE_CHAIN (code);
        }
       break;
index 382711907d34999d712c7e1311bdb956d03ddac8..82cf8659c0f8b7c6e2789a65bf674ef8b321a005 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/19263
+       * g++.dg/init/vector1.C: New test.
+
 2005-01-07  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.c-torture/execute/20050107-1.c: New test.