]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR lto/79061 ([LTO][ASAN] LTO plus ASAN fails with "AddressSanitizer: initializati...
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Fri, 3 Feb 2017 09:13:06 +0000 (09:13 +0000)
committerMaxim Ostapenko <chefmax@gcc.gnu.org>
Fri, 3 Feb 2017 09:13:06 +0000 (11:13 +0200)
PR lto/79061
* asan.c (asan_add_global): Force has_dynamic_init to zero in LTO mode.

From-SVN: r245148

gcc/ChangeLog
gcc/asan.c

index 8126dfb5cf48d13117522e9722d08f4e5eac0b83..3b640ca9bee8525c9799ebd8fa31f0896cd19c46 100644 (file)
@@ -1,3 +1,8 @@
+2017-02-03  Maxim Ostapenko  <m.ostapenko@samsung.com>
+
+       PR lto/79061
+       * asan.c (asan_add_global): Force has_dynamic_init to zero in LTO mode.
+
 2017-01-26  Richard Biener  <rguenther@suse.de>
 
        Backport from mainline
index 9e4a62998179c1dca00a47f790e41ddcc6355027..3b5722a4c9a36e6feca499f3c12df097f6456c9a 100644 (file)
@@ -2244,7 +2244,11 @@ asan_add_global (tree decl, tree type, vec<constructor_elt, va_gc> *v)
   CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE,
                          fold_convert (const_ptr_type_node, module_name_cst));
   varpool_node *vnode = varpool_node::get (decl);
-  int has_dynamic_init = vnode ? vnode->dynamically_initialized : 0;
+  int has_dynamic_init = 0;
+  /* FIXME: Enable initialization order fiasco detection in LTO mode once
+     proper fix for PR 79061 will be applied.  */
+  if (!in_lto_p)
+    has_dynamic_init = vnode ? vnode->dynamically_initialized : 0;
   CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE,
                          build_int_cst (uptr, has_dynamic_init));
   tree locptr = NULL_TREE;