+2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34985
+ * c-decl.c (merge_decls): Merge USED flags.
+
2008-07-29 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (sh_gimplify_va_arg_expr): Unshare the addr,
extern_changed = DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl);
+ /* Merge the USED information. */
+ if (TREE_USED (olddecl))
+ TREE_USED (newdecl) = 1;
+ else if (TREE_USED (newdecl))
+ TREE_USED (olddecl) = 1;
+
/* Copy most of the decl-specific fields of NEWDECL into OLDDECL.
But preserve OLDDECL's DECL_UID and DECL_CONTEXT. */
{
+2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34985
+ * decl.c (duplicate_decls): Merge USED flags.
+
2008-07-27 Jason Merrill <jason@redhat.com>
PR c++/36943
ggc_free (DECL_LANG_SPECIFIC (olddecl));
}
+ /* Merge the USED information. */
+ if (TREE_USED (olddecl))
+ TREE_USED (newdecl) = 1;
+ else if (TREE_USED (newdecl))
+ TREE_USED (olddecl) = 1;
+
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
int function_size;
+2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34985
+ * gcc.dg/pr34985.c: New.
+ * g++.dg/warn/pr34985.C: New.
+
2008-07-29 Daniel Kraft <d@domob.eu>
PR fortran/36403
--- /dev/null
+/* PR34985: Warning "defined but not used" despite __attribute__((__used__)) */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -O2" } */
+static void xxyyzz (void);
+static void __attribute__((__used__)) xxyyzz(void)
+{
+}
+
+/* { dg-final { scan-assembler "xxyyzz" } } */
--- /dev/null
+/* PR34985: Warning "defined but not used" despite __attribute__((__used__)) */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -O2" } */
+static void xxyyzz (void);
+static void __attribute__((__used__)) xxyyzz(void)
+{
+}
+
+/* { dg-final { scan-assembler "xxyyzz" } } */