From 3a7b8591cba180cae5e206ffb877612e3071bbab Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 24 Feb 2015 11:27:43 +0000 Subject: [PATCH] backport: [multiple changes] 2015-02-24 Richard Biener Backport from mainline 2015-02-11 Richard Biener PR lto/65015 * dwarf2out.c (gen_producer_string): Drop -fltrans-output-list and -fresolution. 2015-02-13 Richard Biener PR lto/65015 * dwarf2out.c (dwarf2out_finish): Use as DW_AT_name for LTO produced CUs. 2015-02-16 Richard Biener PR lto/65015 * varasm.c (default_file_start): For LTO produced units emit as file directive. 2015-01-17 Jan Kratochvil * dwarf2out.c (gen_producer_string): Ignore also OPT_fpreprocessed. From-SVN: r220938 --- gcc/ChangeLog | 25 +++++++++++++++++++++++++ gcc/dwarf2out.c | 12 ++++++++++-- gcc/varasm.c | 8 +++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c48fa0719e94..fcca28be6c6f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,28 @@ +2015-02-24 Richard Biener + + Backport from mainline + 2015-02-11 Richard Biener + + PR lto/65015 + * dwarf2out.c (gen_producer_string): Drop -fltrans-output-list + and -fresolution. + + 2015-02-13 Richard Biener + + PR lto/65015 + * dwarf2out.c (dwarf2out_finish): Use as DW_AT_name + for LTO produced CUs. + + 2015-02-16 Richard Biener + + PR lto/65015 + * varasm.c (default_file_start): For LTO produced units + emit as file directive. + + 2015-01-17 Jan Kratochvil + + * dwarf2out.c (gen_producer_string): Ignore also OPT_fpreprocessed. + 2015-02-23 Oleg Endo Backport from mainline diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c68453e984b6..c04f8136c85c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -18812,6 +18812,9 @@ gen_producer_string (void) case OPT__sysroot_: case OPT_nostdinc: case OPT_nostdinc__: + case OPT_fpreprocessed: + case OPT_fltrans_output_list_: + case OPT_fresolution_: /* Ignore these. */ continue; default: @@ -23316,8 +23319,13 @@ dwarf2out_finish (const char *filename) gen_remaining_tmpl_value_param_die_attribute (); /* Add the name for the main input file now. We delayed this from - dwarf2out_init to avoid complications with PCH. */ - add_name_attribute (comp_unit_die (), remap_debug_filename (filename)); + dwarf2out_init to avoid complications with PCH. + For LTO produced units use a fixed artificial name to avoid + leaking tempfile names into the dwarf. */ + if (!in_lto_p) + add_name_attribute (comp_unit_die (), remap_debug_filename (filename)); + else + add_name_attribute (comp_unit_die (), ""); if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir) add_comp_dir_attribute (comp_unit_die ()); else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL) diff --git a/gcc/varasm.c b/gcc/varasm.c index 85b1b56a5845..eb406b7cc96a 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -6851,7 +6851,13 @@ default_file_start (void) fputs (ASM_APP_OFF, asm_out_file); if (targetm.asm_file_start_file_directive) - output_file_directive (asm_out_file, main_input_filename); + { + /* LTO produced units have no meaningful main_input_filename. */ + if (in_lto_p) + output_file_directive (asm_out_file, ""); + else + output_file_directive (asm_out_file, main_input_filename); + } } /* This is a generic routine suitable for use as TARGET_ASM_FILE_END -- 2.47.2