diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-11-29 08:42:23 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-11-29 08:42:23 +0100 |
commit | fad7652e6e9077252612963bc5a0e35015df3753 (patch) | |
tree | 766e150a7320db99315930b0db1c3e4619c298d2 /gcc | |
parent | b82e0d0d70948d9bcfe4e43e416a8e9e2baca707 (diff) | |
download | gcc-fad7652e6e9077252612963bc5a0e35015df3753.zip gcc-fad7652e6e9077252612963bc5a0e35015df3753.tar.gz gcc-fad7652e6e9077252612963bc5a0e35015df3753.tar.bz2 |
re PR c/59280 (ICE with attribute((constructor(invalid))))
PR c/59280
* c-common.c (get_priority): If TREE_VALUE (args) is IDENTIFIER_NODE,
goto invalid. If it is error_mark_node, don't issue further
diagnostics.
testsuite/
* c-c++-common/pr59280.c: New test.
From-SVN: r205510
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/pr59280.c | 4 |
4 files changed, 20 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index f4e0938..12db521 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2013-11-29 Jakub Jelinek <jakub@redhat.com> + + PR c/59280 + * c-common.c (get_priority): If TREE_VALUE (args) is IDENTIFIER_NODE, + goto invalid. If it is error_mark_node, don't issue further + diagnostics. + 2013-11-28 Sergey Ostanevich <sergos.gnu@gmail.com> * c.opt (Wopenmp-simd): New. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 60b069c..0cf22ca 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7014,6 +7014,10 @@ get_priority (tree args, bool is_destructor) } arg = TREE_VALUE (args); + if (TREE_CODE (arg) == IDENTIFIER_NODE) + goto invalid; + if (arg == error_mark_node) + return DEFAULT_INIT_PRIORITY; arg = default_conversion (arg); if (!tree_fits_shwi_p (arg) || !INTEGRAL_TYPE_P (TREE_TYPE (arg))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 56acc0e..8291675 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-11-29 Jakub Jelinek <jakub@redhat.com> + + PR c/59280 + * c-c++-common/pr59280.c: New test. + 2013-11-29 Zhenqiang Chen <zhenqiang.chen@linaro.org> * gcc.target/arm/lp1243022.c: Skip target arm-neon. diff --git a/gcc/testsuite/c-c++-common/pr59280.c b/gcc/testsuite/c-c++-common/pr59280.c new file mode 100644 index 0000000..779f0fb --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr59280.c @@ -0,0 +1,4 @@ +/* PR c/59280 */ +/* { dg-do compile } */ + +void bar (char *) __attribute__((constructor(foo))); /* { dg-error "constructor priorities must be integers|was not declared|constructor priorities are not supported" } */ |