]> 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>
Fri, 1 Feb 2008 18:58:21 +0000 (10:58 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 1 Feb 2008 18:58:21 +0000 (10:58 -0800)
        PR c/34993
        * tree.c (build_type_attribute_qual_variant): Skip TYPE_DOMAIN
        for unbounded arrays.

From-SVN: r132049

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

index 405c00155253e45b8dd5e1a60c0f1fbd79950e5a..9d1a04557e471e73a8a65684d97a06261ca62414 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-31  Richard Henderson  <rth@redhat.com>
+
+        PR c/34993
+        * tree.c (build_type_attribute_qual_variant): Skip TYPE_DOMAIN
+        for unbounded arrays.
+
 2008-01-31  Andreas Krebbel  <krebbel1@de.ibm.com>
 
        * config/s390/fixdfdi.h (__fixunstfdi, __fixtfdi): Rearrange
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 e537e9cd3141cee70579018c7920f5ae70f3a36f..6541344f2e5db802770813f8e1ddb7aace094f22 100644 (file)
@@ -3288,8 +3288,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