public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/experiment-asm-file)] Test it.
@ 2022-10-13 18:52 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2022-10-13 18:52 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:9094bb4c02ac617b997f35cdbe81cafd35ad1b4e
commit 9094bb4c02ac617b997f35cdbe81cafd35ad1b4e
Author: Martin Liska <mliska@suse.cz>
Date: Mon Aug 22 13:38:14 2022 +0200
Test it.
Diff:
---
gcc/cgraphunit.cc | 2 ++
gcc/lto/lto.cc | 1 +
gcc/run-rtl-passes.cc | 4 ++++
gcc/toplev.cc | 9 +++++----
gcc/toplev.h | 2 ++
5 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc
index 7b5be0f1539..a92b2529758 100644
--- a/gcc/cgraphunit.cc
+++ b/gcc/cgraphunit.cc
@@ -2520,6 +2520,8 @@ 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 ();
diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc
index 3a9147b01b5..4ed11ca2c24 100644
--- a/gcc/lto/lto.cc
+++ b/gcc/lto/lto.cc
@@ -684,6 +684,7 @@ lto_main (void)
/* Let the middle end know that we have read and merged all of
the input files. */
+ init_asm_output();
symtab->compile ();
timevar_stop (TV_PHASE_OPT_GEN);
diff --git a/gcc/run-rtl-passes.cc b/gcc/run-rtl-passes.cc
index 5399fb947c7..b35badf1bc6 100644
--- a/gcc/run-rtl-passes.cc
+++ b/gcc/run-rtl-passes.cc
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "insn-attr-common.h" /* for INSN_SCHEDULING. */
#include "insn-attr.h" /* for init_sched_attrs. */
#include "run-rtl-passes.h"
+#include "toplev.h"
/* Run the backend passes, starting at the given pass.
Take ownership of INITIAL_PASS_NAME. */
@@ -45,6 +46,9 @@ run_rtl_passes (char *initial_pass_name)
cfun->pass_startwith = initial_pass_name;
max_regno = max_reg_num ();
+ if (asm_out_file == NULL)
+ init_asm_output ();
+
/* cgraphunit.cc normally handles this. */
switch_to_section (text_section);
(*debug_hooks->assembly_start) ();
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index b53a78bbaf1..7125ad13a2b 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -98,7 +98,6 @@ along with GCC; see the file COPYING3. If not see
static void general_init (const char *, bool);
static void backend_init (void);
static int lang_dependent_init (const char *);
-static void init_asm_output (const char *);
static void finalize (bool);
static void crash_signal (int) ATTRIBUTE_NORETURN;
@@ -675,14 +674,16 @@ print_version (FILE *file, const char *indent, bool show_global_state)
}
+static const char *asm_name;
/* Open assembly code output file. Do this even if -fsyntax-only is
on, because then the driver will have provided the name of a
temporary file or bit bucket for us. NAME is the file specified on
the command line, possibly NULL. */
-static void
-init_asm_output (const char *name)
+void
+init_asm_output ()
{
+ const char *name = asm_name;
if (name == NULL && asm_file_name == 0)
asm_out_file = stdout;
else
@@ -1818,7 +1819,7 @@ lang_dependent_init (const char *name)
if (!flag_wpa)
{
- init_asm_output (name);
+ asm_name = xstrdup (name);
if (!flag_generate_lto && !flag_compare_debug)
{
diff --git a/gcc/toplev.h b/gcc/toplev.h
index a82ef8b8fd3..caedfc616c0 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -99,4 +99,6 @@ extern void parse_alignment_opts (void);
extern void initialize_rtl (void);
+extern void init_asm_output (void);
+
#endif /* ! GCC_TOPLEV_H */
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gcc(refs/users/marxin/heads/experiment-asm-file)] Test it.
@ 2022-10-13 15:49 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2022-10-13 15:49 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2eda0612e760d05702bc4d240f429fb697c20538
commit 2eda0612e760d05702bc4d240f429fb697c20538
Author: Martin Liska <mliska@suse.cz>
Date: Mon Aug 22 13:38:14 2022 +0200
Test it.
Diff:
---
gcc/cgraphunit.cc | 1 +
gcc/lto/lto.cc | 1 +
gcc/toplev.cc | 9 +++++----
gcc/toplev.h | 2 ++
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc
index 7b5be0f1539..5f09e2d8f87 100644
--- a/gcc/cgraphunit.cc
+++ b/gcc/cgraphunit.cc
@@ -2520,6 +2520,7 @@ symbol_table::finalize_compilation_unit (void)
/* Clean up anything that needs cleaning up after initial debug
generation. */
+ init_asm_output ();
debuginfo_early_start ();
(*debug_hooks->early_finish) (main_input_filename);
debuginfo_early_stop ();
diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc
index 3a9147b01b5..4ed11ca2c24 100644
--- a/gcc/lto/lto.cc
+++ b/gcc/lto/lto.cc
@@ -684,6 +684,7 @@ lto_main (void)
/* Let the middle end know that we have read and merged all of
the input files. */
+ init_asm_output();
symtab->compile ();
timevar_stop (TV_PHASE_OPT_GEN);
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index b53a78bbaf1..7125ad13a2b 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -98,7 +98,6 @@ along with GCC; see the file COPYING3. If not see
static void general_init (const char *, bool);
static void backend_init (void);
static int lang_dependent_init (const char *);
-static void init_asm_output (const char *);
static void finalize (bool);
static void crash_signal (int) ATTRIBUTE_NORETURN;
@@ -675,14 +674,16 @@ print_version (FILE *file, const char *indent, bool show_global_state)
}
+static const char *asm_name;
/* Open assembly code output file. Do this even if -fsyntax-only is
on, because then the driver will have provided the name of a
temporary file or bit bucket for us. NAME is the file specified on
the command line, possibly NULL. */
-static void
-init_asm_output (const char *name)
+void
+init_asm_output ()
{
+ const char *name = asm_name;
if (name == NULL && asm_file_name == 0)
asm_out_file = stdout;
else
@@ -1818,7 +1819,7 @@ lang_dependent_init (const char *name)
if (!flag_wpa)
{
- init_asm_output (name);
+ asm_name = xstrdup (name);
if (!flag_generate_lto && !flag_compare_debug)
{
diff --git a/gcc/toplev.h b/gcc/toplev.h
index a82ef8b8fd3..caedfc616c0 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -99,4 +99,6 @@ extern void parse_alignment_opts (void);
extern void initialize_rtl (void);
+extern void init_asm_output (void);
+
#endif /* ! GCC_TOPLEV_H */
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gcc(refs/users/marxin/heads/experiment-asm-file)] Test it.
@ 2022-09-09 8:47 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2022-09-09 8:47 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:15b57deeace98458b8cd4994d9037428aa69537f
commit 15b57deeace98458b8cd4994d9037428aa69537f
Author: Martin Liska <mliska@suse.cz>
Date: Mon Aug 22 13:38:14 2022 +0200
Test it.
Diff:
---
gcc/cgraphunit.cc | 1 +
gcc/lto/lto.cc | 1 +
gcc/toplev.cc | 9 +++++----
gcc/toplev.h | 2 ++
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc
index 7b5be0f1539..5f09e2d8f87 100644
--- a/gcc/cgraphunit.cc
+++ b/gcc/cgraphunit.cc
@@ -2520,6 +2520,7 @@ symbol_table::finalize_compilation_unit (void)
/* Clean up anything that needs cleaning up after initial debug
generation. */
+ init_asm_output ();
debuginfo_early_start ();
(*debug_hooks->early_finish) (main_input_filename);
debuginfo_early_stop ();
diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc
index 3a9147b01b5..4ed11ca2c24 100644
--- a/gcc/lto/lto.cc
+++ b/gcc/lto/lto.cc
@@ -684,6 +684,7 @@ lto_main (void)
/* Let the middle end know that we have read and merged all of
the input files. */
+ init_asm_output();
symtab->compile ();
timevar_stop (TV_PHASE_OPT_GEN);
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index 924871fa9a8..6b9c4781d16 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -98,7 +98,6 @@ along with GCC; see the file COPYING3. If not see
static void general_init (const char *, bool);
static void backend_init (void);
static int lang_dependent_init (const char *);
-static void init_asm_output (const char *);
static void finalize (bool);
static void crash_signal (int) ATTRIBUTE_NORETURN;
@@ -675,14 +674,16 @@ print_version (FILE *file, const char *indent, bool show_global_state)
}
+static const char *asm_name;
/* Open assembly code output file. Do this even if -fsyntax-only is
on, because then the driver will have provided the name of a
temporary file or bit bucket for us. NAME is the file specified on
the command line, possibly NULL. */
-static void
-init_asm_output (const char *name)
+void
+init_asm_output ()
{
+ const char *name = asm_name;
if (name == NULL && asm_file_name == 0)
asm_out_file = stdout;
else
@@ -1818,7 +1819,7 @@ lang_dependent_init (const char *name)
if (!flag_wpa)
{
- init_asm_output (name);
+ asm_name = xstrdup (name);
if (!flag_generate_lto && !flag_compare_debug)
{
diff --git a/gcc/toplev.h b/gcc/toplev.h
index a82ef8b8fd3..caedfc616c0 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -99,4 +99,6 @@ extern void parse_alignment_opts (void);
extern void initialize_rtl (void);
+extern void init_asm_output (void);
+
#endif /* ! GCC_TOPLEV_H */
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-13 18:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-13 18:52 [gcc(refs/users/marxin/heads/experiment-asm-file)] Test it Martin Liska
-- strict thread matches above, loose matches on Subject: below --
2022-10-13 15:49 Martin Liska
2022-09-09 8:47 Martin Liska
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).