]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/34917 (ICE with const vector)
authorJakub Jelinek <jakub@redhat.com>
Tue, 22 Jan 2008 16:18:14 +0000 (17:18 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 22 Jan 2008 16:18:14 +0000 (17:18 +0100)
PR c++/34917
* tree.c (build_type_attribute_qual_variant): Call
build_qualified_type if attributes are equal, but quals are not.

* g++.dg/ext/vector12.C: New test.

From-SVN: r131726

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/vector12.C [new file with mode: 0644]
gcc/tree.c

index bc76be76da41992e02bedbe1da43bf6260102d2e..a720103fb859e3747637583d592bba84176985f4 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/34917
+       * tree.c (build_type_attribute_qual_variant): Call
+       build_qualified_type if attributes are equal, but quals are not.
+
 2008-01-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
 
        PR 32102
index 9a6eb68daab25da7a914c054d45cb4221cdde38a..7f0c716a0698578fb7cd105ee07e276aaf8275f4 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/34917
+       * g++.dg/ext/vector12.C: New test.
+
 2008-01-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
 
        PR 32102
diff --git a/gcc/testsuite/g++.dg/ext/vector12.C b/gcc/testsuite/g++.dg/ext/vector12.C
new file mode 100644 (file)
index 0000000..e0b6d2b
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/34917
+// { dg-do compile }
+
+const int i __attribute ((vector_size (8))) = {};
index 4757cbccc1374ddefe6063f18ddbb37b35b3a3b9..b6b3eef26e19b8ca1d36627d993ff14fbab88247 100644 (file)
@@ -3735,6 +3735,8 @@ build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
 
       ttype = build_qualified_type (ntype, quals);
     }
+  else if (TYPE_QUALS (ttype) != quals)
+    ttype = build_qualified_type (ttype, quals);
 
   return ttype;
 }