aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMaxim Ostapenko <m.ostapenko@samsung.com>2017-01-25 07:45:40 +0000
committerMaxim Ostapenko <chefmax@gcc.gnu.org>2017-01-25 09:45:40 +0200
commite5e391d630476b0ea2ff2dc01db7f8dfcb037974 (patch)
tree7dea5db302e97ca5ad9684bbe3f3cfc517681e41 /gcc/c
parent98e20758464f5cbfc60bd61a0cadd66ebb900d96 (diff)
downloadgcc-e5e391d630476b0ea2ff2dc01db7f8dfcb037974.zip
gcc-e5e391d630476b0ea2ff2dc01db7f8dfcb037974.tar.gz
gcc-e5e391d630476b0ea2ff2dc01db7f8dfcb037974.tar.bz2
re PR lto/79061 ([LTO][ASAN] LTO plus ASAN fails with "AddressSanitizer: initialization-order-fiasco")
PR lto/79061 gcc/ * asan.c (get_translation_unit_decl): New function. (asan_add_global): Extract modules file name from globals TRANSLATION_UNIT_DECL name. gcc/fortran/ * f95-lang.c (gfc_create_decls): Include stringpool.h. Pass main_input_filename to build_translation_unit_decl. gcc/ada/ * gcc-interface/utils.c (get_global_context): Pass main_input_filename to build_translation_unit_decl. gcc/c/ * c-decl.c (pop_scope): Pass main_input_filename to build_translation_unit_decl. gcc/cp/ * decl.c (cxx_init_decl_processing): Pass main_input_filename to build_translation_unit_decl. From-SVN: r244890
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-decl.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index b17c179..16fb6f8 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR lto/79061
+ * c-decl.c (pop_scope): Pass main_input_filename to
+ build_translation_unit_decl.
+
2017-01-24 David Malcolm <dmalcolm@redhat.com>
* c-parser.c: Include "read-rtl-function.h" and
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 2f91e70..32edacc 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -1177,7 +1177,8 @@ pop_scope (void)
context = current_function_decl;
else if (scope == file_scope)
{
- tree file_decl = build_translation_unit_decl (NULL_TREE);
+ tree file_decl
+ = build_translation_unit_decl (get_identifier (main_input_filename));
context = file_decl;
debug_hooks->register_main_translation_unit (file_decl);
}