Commit 1d30139d by Joseph Myers Committed by Joseph Myers

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
parent 7ded4467
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> Tue Sep 11 11:37:52 CEST 2001 Jan Hubicka <jh@suse.cz>
* basic-block.h (cached_make_edge, make_single_succ): New. * basic-block.h (cached_make_edge, make_single_succ): New.
......
...@@ -1204,7 +1204,9 @@ split_specs_attrs (specs_attrs, declspecs, prefix_attributes) ...@@ -1204,7 +1204,9 @@ split_specs_attrs (specs_attrs, declspecs, prefix_attributes)
s = t; 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) if (attrs == NULL_TREE)
attrs = a = TREE_PURPOSE (t); attrs = a = TREE_PURPOSE (t);
......
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> 2001-09-10 Janis Johnson <janis187@us.ibm.com>
* lib/profopt.exp: New, to support profile-directed optimizations. * lib/profopt.exp: New, to support profile-directed optimizations.
......
/* Test for segfault handling an empty attribute. */
/* Origin: PR c/4294 from <tori@ringstrom.mine.nu>. */
void __attribute__(()) foo();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment