re PR sanitizer/60745 (Many ICEs running libstdc++ testsuite with ubsan, maybe due...
authorMarek Polacek <polacek@redhat.com>
Tue, 8 Apr 2014 17:23:26 +0000 (17:23 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 8 Apr 2014 17:23:26 +0000 (17:23 +0000)
PR sanitizer/60745
* c-ubsan.c: Include asan.h.
(ubsan_instrument_return): Call initialize_sanitizer_builtins.

From-SVN: r209222

gcc/c-family/ChangeLog
gcc/c-family/c-ubsan.c

index e2b047482c55abc67132011fc3152c59911def68..152c3b7def33c690d388deaa18644f1c9f56d8e0 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-08  Marek Polacek  <polacek@redhat.com>
+
+       PR sanitizer/60745
+       * c-ubsan.c: Include asan.h.
+       (ubsan_instrument_return): Call initialize_sanitizer_builtins.
+
 2014-04-03  Nathan Sidwell  <nathan@codesourcery.com>
 
        * c.opt (Wnon-virtual-dtor): Auto set when Weffc++.
index dc4d98147b3292a268903f887f18350f5bca61ae..e89ebc1873befae7a71af8a01b0f0f72ddb935d0 100644 (file)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ubsan.h"
 #include "c-family/c-common.h"
 #include "c-family/c-ubsan.h"
+#include "asan.h"
 
 /* Instrument division by zero and INT_MIN / -1.  If not instrumenting,
    return NULL_TREE.  */
@@ -185,6 +186,10 @@ ubsan_instrument_vla (location_t loc, tree size)
 tree
 ubsan_instrument_return (location_t loc)
 {
+  /* It is possible that PCH zapped table with definitions of sanitizer
+     builtins.  Reinitialize them if needed.  */
+  initialize_sanitizer_builtins ();
+
   tree data = ubsan_create_data ("__ubsan_missing_return_data", &loc,
                                 NULL, NULL_TREE);
   tree t = builtin_decl_explicit (BUILT_IN_UBSAN_HANDLE_MISSING_RETURN);