[Bug sanitizer/66452] [6 Regression] [UBSAN] *.Lubsan_data0' defined but not used

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 8 08:45:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66452

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I'm testing

--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -534,6 +534,7 @@ check_global_declaration (tree decl)
         to handle multiple external decls in different scopes.  */
       && ! (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl)))
       && ! DECL_EXTERNAL (decl)
+      && ! DECL_ARTIFICIAL (decl)
       && ! TREE_PUBLIC (decl)
       /* A volatile variable might be used in some non-obvious way.  */
       && ! TREE_THIS_VOLATILE (decl)

(Maybe we should also test !TREE_NO_WARNING but the above is enough to fix
this.)



More information about the Gcc-bugs mailing list