]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/34993 (ICE with attribute for array with unknown bound)
authorRichard Henderson <rth@redhat.com>
Sat, 2 Feb 2008 20:42:10 +0000 (12:42 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 2 Feb 2008 20:42:10 +0000 (12:42 -0800)
        PR c/34993
        * tree.c (build_type_attribute_qual_variant): Skip TYPE_DOMAIN
        for unbounded arrays.

From-SVN: r132073

gcc/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr34993.c [new file with mode: 0644]
gcc/tree.c

index f20a1d463199f4c3b2a79da437ffabb2f88b55fb..902470a049587ee2f54170be145f4d2c5e47d52f 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-02  Richard Henderson  <rth@redhat.com>
+
+        PR c/34993
+        * tree.c (build_type_attribute_qual_variant): Skip TYPE_DOMAIN
+        for unbounded arrays.
+
 2008-02-02  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        PR target/34981
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34993.c b/gcc/testsuite/gcc.c-torture/compile/pr34993.c
new file mode 100644 (file)
index 0000000..ced4d56
--- /dev/null
@@ -0,0 +1,5 @@
+/* PR c/34993 */
+
+/* { dg-do compile } */
+
+typedef int x[] __attribute((may_alias));
index f4beaf021ebe325b562cd6a716432f9a4d2e242c..21ab1cbee59f8fb2356990f9f5f493c3e7d149ba 100644 (file)
@@ -3394,8 +3394,9 @@ build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
          hashcode = type_hash_list (TYPE_ARG_TYPES (ntype), hashcode);
          break;
        case ARRAY_TYPE:
-         hashcode = iterative_hash_object (TYPE_HASH (TYPE_DOMAIN (ntype)),
-                                           hashcode);
+         if (TYPE_DOMAIN (ntype))
+           hashcode = iterative_hash_object (TYPE_HASH (TYPE_DOMAIN (ntype)),
+                                             hashcode);
          break;
        case INTEGER_TYPE:
          hashcode = iterative_hash_object