aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2015-12-01 15:44:08 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2015-12-01 15:44:08 +0000
commit8b6ab677a214c9ae86ab4644af573b93bfd84b03 (patch)
treef379aee6d108102c1d3af28866f4af7a0127481b /gcc/cgraphunit.c
parent6c59645f5de1af1dff9715a5bd30f21f29cf2607 (diff)
downloadgcc-8b6ab677a214c9ae86ab4644af573b93bfd84b03.zip
gcc-8b6ab677a214c9ae86ab4644af573b93bfd84b03.tar.gz
gcc-8b6ab677a214c9ae86ab4644af573b93bfd84b03.tar.bz2
re PR middle-end/68582 (-Wunused-function doesn't warn about unused static __attribute__((noreturn)) functions)
PR middle-end/68582 * cgraphunit.c (check_global_declaration): Only depend on TREE_THIS_VOLATILE for VAR_DECLs. * c-c++-common/pr68582.c: New test. From-SVN: r231116
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index f73d9a7..4ce5f9b 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -956,7 +956,7 @@ check_global_declaration (symtab_node *snode)
&& ! DECL_ABSTRACT_ORIGIN (decl)
&& ! TREE_PUBLIC (decl)
/* A volatile variable might be used in some non-obvious way. */
- && ! TREE_THIS_VOLATILE (decl)
+ && (! VAR_P (decl) || ! TREE_THIS_VOLATILE (decl))
/* Global register variables must be declared to reserve them. */
&& ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
/* Global ctors and dtors are called by the runtime. */