]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/59280 (ICE with attribute((constructor(invalid))))
authorJakub Jelinek <jakub@redhat.com>
Fri, 29 Nov 2013 07:42:23 +0000 (08:42 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 29 Nov 2013 07:42:23 +0000 (08:42 +0100)
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

gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr59280.c [new file with mode: 0644]

index f4e09381e72f306d7da7a8993acbcebfe98763bf..12db5210aaf0b9d6357c278f43f19417be6f97fe 100644 (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.
index 60b069cdb69c3937bca87d15f43151c4ed1c66f8..0cf22ca1f5d25fdbf46becb3371c91112d720b3e 100644 (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)))
index 56acc0e322b781600d71084b2ce29b9185f34a43..82916752314b49cb85a296b194e5b5f43d85b5d4 100644 (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.
diff --git a/gcc/testsuite/c-c++-common/pr59280.c b/gcc/testsuite/c-c++-common/pr59280.c
new file mode 100644 (file)
index 0000000..779f0fb
--- /dev/null
@@ -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" } */