re PR libmudflap/53359 (undefined reference to `__gnu_cxx::__numeric_traits_integer...
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 18 Jan 2013 10:57:58 +0000 (10:57 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 18 Jan 2013 10:57:58 +0000 (10:57 +0000)
PR libmudflap/53359
* tree-mudflap.c (mudflap_finish_file): Skip deferred decls
not found in the symtab.

From-SVN: r195290

gcc/ChangeLog
gcc/tree-mudflap.c

index 6eff629fe0b6aa637d15766673e13a0d5ea9c06d..9763bca179dbaf0ed5158229c8fe2656a244ab62 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-18  Alexandre Oliva <aoliva@redhat.com>
+
+       PR libmudflap/53359
+       * tree-mudflap.c (mudflap_finish_file): Skip deferred decls
+       not found in the symtab.
+
 2013-01-18  Alexandre Oliva <aoliva@redhat.com>
 
        PR rtl-optimization/55547
index 3c866bc7f05a2d486977524c3f992f8fc20de2c0..b250bfefadb33aa3cea75c99e26940544baaccfd 100644 (file)
@@ -1334,6 +1334,16 @@ mudflap_finish_file (void)
           if (! TREE_PUBLIC (obj) && ! TREE_ADDRESSABLE (obj))
             continue;
 
+         /* If we're neither emitting nor referencing the symbol,
+            don't register it.  We have to register external symbols
+            if they happen to be in other files not compiled with
+            mudflap (say system libraries), and we must not register
+            internal symbols that we don't emit or they'll become
+            dangling references or force symbols to be emitted that
+            didn't have to.  */
+         if (!symtab_get_node (obj))
+           continue;
+
           if (! COMPLETE_TYPE_P (TREE_TYPE (obj)))
             {
               warning (OPT_Wmudflap,