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
This commit is contained in:
Jakub Jelinek 2013-11-29 08:42:23 +01:00 committed by Jakub Jelinek
parent b82e0d0d70
commit fad7652e6e
4 changed files with 20 additions and 0 deletions

View File

@ -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.

View File

@ -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)))

View File

@ -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.

View File

@ -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" } */