diff options
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/c-common.c | 4 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20010911-1.c | 4 |
4 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 266154b..306bf2a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/c-common.c b/gcc/c-common.c index 72b1417..91f4b0a 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 852b1e8..6dc91cd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/gcc.c-torture/compile/20010911-1.c b/gcc/testsuite/gcc.c-torture/compile/20010911-1.c new file mode 100644 index 0000000..f5a4724 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20010911-1.c @@ -0,0 +1,4 @@ +/* Test for segfault handling an empty attribute. */ +/* Origin: PR c/4294 from <tori@ringstrom.mine.nu>. */ + +void __attribute__(()) foo(); |
