aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2001-09-11 13:52:04 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2001-09-11 13:52:04 +0100
commit1d30139d37ad8281957c875475c6a496b37ab015 (patch)
tree354be61dc8d5de0aee47b0c3f2080226630fc950 /gcc
parent7ded4467c9ee286111320967832db758d71acf4c (diff)
downloadgcc-1d30139d37ad8281957c875475c6a496b37ab015.zip
gcc-1d30139d37ad8281957c875475c6a496b37ab015.tar.gz
gcc-1d30139d37ad8281957c875475c6a496b37ab015.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-common.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010911-1.c4
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();