re PR c/4294 (ICE for bad empty attribute)

* c-common.c (split_specs_attrs): Allow for empty attributes with
	empty TREE_PURPOSE.  Fixes PR c/4294.

testsuite:
	* gcc.c-torture/compile/20010911-1.c: New test.

From-SVN: r45541
This commit is contained in:
Joseph Myers 2001-09-11 13:52:04 +01:00 committed by Joseph Myers
parent 7ded4467c9
commit 1d30139d37
4 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2001-09-11 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (split_specs_attrs): Allow for empty attributes with
empty TREE_PURPOSE. Fixes PR c/4294.
Tue Sep 11 11:37:52 CEST 2001 Jan Hubicka <jh@suse.cz>
* basic-block.h (cached_make_edge, make_single_succ): New.

View File

@ -1204,7 +1204,9 @@ split_specs_attrs (specs_attrs, declspecs, prefix_attributes)
s = t;
}
}
else
/* The TREE_PURPOSE may also be empty in the case of
__attribute__(()). */
else if (TREE_PURPOSE (t) != NULL_TREE)
{
if (attrs == NULL_TREE)
attrs = a = TREE_PURPOSE (t);

View File

@ -1,3 +1,7 @@
2001-09-11 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.c-torture/compile/20010911-1.c: New test.
2001-09-10 Janis Johnson <janis187@us.ibm.com>
* lib/profopt.exp: New, to support profile-directed optimizations.

View File

@ -0,0 +1,4 @@
/* Test for segfault handling an empty attribute. */
/* Origin: PR c/4294 from <tori@ringstrom.mine.nu>. */
void __attribute__(()) foo();