]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/35744 (ICE attributes for invalid types)
authorVolker Reichelt <v.reichelt@netcologne.de>
Thu, 17 Apr 2008 19:41:50 +0000 (19:41 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Thu, 17 Apr 2008 19:41:50 +0000 (19:41 +0000)
PR c/35744
* attribs.c (decl_attributes): Return early on errorneous node.

* gcc.dg/attr-error-1.c: New test.

From-SVN: r134409

gcc/ChangeLog
gcc/attribs.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/attr-error-1.c [new file with mode: 0644]

index 58cb5dd006c0b8167fc05d1c54322cfae378dd98..0815f0aeb1c7a57e448d157b9799636d1e0b2dcb 100644 (file)
@@ -1,5 +1,8 @@
 2008-04-17  Volker Reichelt  <v.reichelt@netcologne.de>
 
+       PR c/35744
+       * attribs.c (decl_attributes): Return early on errorneous node.
+
        PR c/35436
        * c-format.c (init_dynamic_gfc_info): Ignore invalid locus type.
 
index cbc605632810af794534e81fb7ad8f6af5fd0ab4..629f3171274962c8c1b99d6c33a77d349eb17e2d 100644 (file)
@@ -138,6 +138,9 @@ decl_attributes (tree *node, tree attributes, int flags)
   tree a;
   tree returned_attrs = NULL_TREE;
 
+  if (TREE_TYPE (*node) == error_mark_node)
+    return NULL_TREE;
+
   if (!attributes_initialized)
     init_attributes ();
 
index fa8b6ed67839ef959575dba1ad428ff00df94ae4..372b94b51f6e410c9a704a3a288d0bb91443f4e7 100644 (file)
@@ -1,5 +1,8 @@
 2008-04-17  Volker Reichelt  <v.reichelt@netcologne.de>
 
+       PR c/35744
+       * gcc.dg/attr-error-1.c: New test.
+
        PR c/35436
        * gcc.dg/format/gcc_gfc-2.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/attr-error-1.c b/gcc/testsuite/gcc.dg/attr-error-1.c
new file mode 100644 (file)
index 0000000..c136484
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR c/35744 */
+
+typedef char a[N] __attribute__((aligned(4))); /* { dg-error "undeclared" } */
+
+void c[1] __attribute__((vector_size(8))); /* { dg-error "array of voids" } */
+
+void b[1] __attribute__((may_alias)); /* { dg-error "array of voids" } */
+
+struct A
+{
+  void d[1] __attribute__((packed)); /* { dg-error "array of voids" } */
+};