From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id F14983857BB5; Fri, 14 Oct 2022 10:26:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F14983857BB5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665743183; bh=nKKKsGV6MtgLyE87xlSjoYK9fwgxnw/ePNsSoBOpoxM=; h=From:To:Subject:Date:From; b=gpKCbh3kT0T4GYqVTRar5lf+nIKOGSjJ3oX8Z1AibXPOmeB4N0K3eqWWrItrxID8C jJR7OlZenIwchpwqdpbM2dRPfdKIMsvLGX2dOFjnsUuckJ9sKLvawJLkORo/NpQAOy sv2HanXKiM+RzpHV208I+tycewwX6yGm4my4KKKQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/experiment-asm-file)] Move asm_out_file creation after early LTO debug info. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/experiment-asm-file X-Git-Oldrev: 252410eaac633ec4d9491ee4d4211ce81200dcf0 X-Git-Newrev: 0914ca9f9bf13c16e0191f7a4542eb18fb8e52f8 Message-Id: <20221014102623.F14983857BB5@sourceware.org> Date: Fri, 14 Oct 2022 10:26:23 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0914ca9f9bf13c16e0191f7a4542eb18fb8e52f8 commit 0914ca9f9bf13c16e0191f7a4542eb18fb8e52f8 Author: Martin Liska Date: Fri Oct 14 12:23:00 2022 +0200 Move asm_out_file creation after early LTO debug info. Diff: --- gcc/cgraphunit.cc | 5 +++-- gcc/dwarf2out.cc | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc index a92b2529758..b13fd5a2b8a 100644 --- a/gcc/cgraphunit.cc +++ b/gcc/cgraphunit.cc @@ -2520,11 +2520,12 @@ symbol_table::finalize_compilation_unit (void) /* Clean up anything that needs cleaning up after initial debug generation. */ - if (asm_out_file == NULL) - init_asm_output (); debuginfo_early_start (); (*debug_hooks->early_finish) (main_input_filename); debuginfo_early_stop (); + + if (asm_out_file == NULL) + init_asm_output (); } /* Finally drive the pass manager. */ diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 6fde9e56868..8addd6ce3f3 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -33044,7 +33044,7 @@ dwarf2out_early_finish (const char *filename) || TARGET_PECOFF || TARGET_COFF) return; - FILE *current_asm_file = asm_out_file; + gcc_assert (asm_out_file == NULL); asm_out_file = fopen ("/tmp/lto-debug.s", "w"); targetm.asm_out.file_start (); @@ -33174,8 +33174,8 @@ dwarf2out_early_finish (const char *filename) targetm.asm_out.file_end (); fclose (asm_out_file); - asm_out_file = current_asm_file; wipe_section_cache (); + init_asm_output (); /* Switch back to the text section. */ switch_to_section (text_section);