aboutsummaryrefslogtreecommitdiff
path: root/gcc/asan.c
diff options
context:
space:
mode:
authorMaxim Ostapenko <chefmax@gcc.gnu.org>2017-01-23 11:12:29 +0200
committerMaxim Ostapenko <chefmax@gcc.gnu.org>2017-01-23 11:12:29 +0200
commite3d53f96ed595fd6e8bef75f166a93e5309b0c2a (patch)
treeb00bc74146414cdc735ba7984a03a985eb0aeb9b /gcc/asan.c
parent54d7c70c08b5b4a0180269301d466cc5e3d951b5 (diff)
downloadgcc-e3d53f96ed595fd6e8bef75f166a93e5309b0c2a.zip
gcc-e3d53f96ed595fd6e8bef75f166a93e5309b0c2a.tar.gz
gcc-e3d53f96ed595fd6e8bef75f166a93e5309b0c2a.tar.bz2
re PR lto/79061 ([LTO][ASAN] LTO plus ASAN fails with "AddressSanitizer: initialization-order-fiasco")
Revert fix for PR lto/79061 due to this regresses compile-time by 100% on some fortran cases. From-SVN: r244773
Diffstat (limited to 'gcc/asan.c')
-rw-r--r--gcc/asan.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/gcc/asan.c b/gcc/asan.c
index 9a59fe4..7450044 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -2372,22 +2372,6 @@ asan_needs_odr_indicator_p (tree decl)
&& TREE_PUBLIC (decl));
}
-/* For given DECL return its corresponding TRANSLATION_UNIT_DECL. */
-
-static const_tree
-get_translation_unit_decl (tree decl)
-{
- const_tree context = decl;
- while (context && TREE_CODE (context) != TRANSLATION_UNIT_DECL)
- {
- if (TREE_CODE (context) == BLOCK)
- context = BLOCK_SUPERCONTEXT (context);
- else
- context = get_containing_scope (context);
- }
- return context;
-}
-
/* Append description of a single global DECL into vector V.
TYPE is __asan_global struct type as returned by asan_global_struct. */
@@ -2407,14 +2391,7 @@ asan_add_global (tree decl, tree type, vec<constructor_elt, va_gc> *v)
pp_string (&asan_pp, "<unknown>");
str_cst = asan_pp_string (&asan_pp);
- const char *filename = main_input_filename;
- if (in_lto_p)
- {
- const_tree translation_unit_decl = get_translation_unit_decl (decl);
- if (translation_unit_decl)
- filename = DECL_SOURCE_FILE (translation_unit_decl);
- }
- pp_string (&module_name_pp, filename);
+ pp_string (&module_name_pp, main_input_filename);
module_name_cst = asan_pp_string (&module_name_pp);
if (asan_needs_local_alias (decl))