+2015-12-01 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/68582
+ * cgraphunit.c (check_global_declaration): Only depend on TREE_THIS_VOLATILE
+ for VAR_DECLs.
+
2015-12-01 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/68474
&& ! 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. */
+2015-12-01 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/68582
+ * c-c++-common/pr68582.c: New test.
+
2015-12-01 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/68474
--- /dev/null
+/* PR middle-end/68582 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused-function" } */
+
+/* We failed to give the warning for functions with TREE_THIS_VOLATILE set. */
+
+static void
+fn1 (void) /* { dg-warning "defined but not used" } */
+{
+ __builtin_abort ();
+}
+
+__attribute__ ((noreturn))
+static void
+fn2 (void) /* { dg-warning "defined but not used" } */
+{
+ __builtin_abort ();
+}
+
+__attribute__ ((volatile))
+static void
+fn3 (void) /* { dg-warning "defined but not used" } */
+{
+ __builtin_abort ();
+}