]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR sanitizer/71953 (ICE using address sanitizers with PCH)
authorJakub Jelinek <jakub@redhat.com>
Tue, 30 May 2017 07:06:38 +0000 (09:06 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 30 May 2017 07:06:38 +0000 (09:06 +0200)
Backported from mainline
2016-07-21  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/71953
* asan.c (asan_dynamic_init_call): Call asan_init_shadow_ptr_types
before builtin_decl_implicit.

From-SVN: r248592

gcc/ChangeLog
gcc/asan.c

index 521d41f82902d3a41b2e2decbfe18f9c79ca445f..a7cb8d67ce196d557d3eb3ca3214ee34d15405a2 100644 (file)
@@ -1,3 +1,12 @@
+2017-05-30  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2016-07-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR sanitizer/71953
+       * asan.c (asan_dynamic_init_call): Call asan_init_shadow_ptr_types
+       before builtin_decl_implicit.
+
 2017-05-29  Eric Botcazou  <ebotcazou@adacore.com>
 
        * doc/install.texi (Options specification): Move entry of
index 3b5722a4c9a36e6feca499f3c12df097f6456c9a..06094925caefeaf873747915914855f7e784a7b7 100644 (file)
@@ -2129,6 +2129,9 @@ transform_statements (void)
 tree
 asan_dynamic_init_call (bool after_p)
 {
+  if (shadow_ptr_types[0] == NULL_TREE)
+    asan_init_shadow_ptr_types ();
+
   tree fn = builtin_decl_implicit (after_p
                                   ? BUILT_IN_ASAN_AFTER_DYNAMIC_INIT
                                   : BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT);
@@ -2138,8 +2141,6 @@ asan_dynamic_init_call (bool after_p)
       pretty_printer module_name_pp;
       pp_string (&module_name_pp, main_input_filename);
 
-      if (shadow_ptr_types[0] == NULL_TREE)
-       asan_init_shadow_ptr_types ();
       module_name_cst = asan_pp_string (&module_name_pp);
       module_name_cst = fold_convert (const_ptr_type_node,
                                      module_name_cst);