* [PATCH] Fix collection and processing of autoprofile data for target libs
@ 2023-06-27 21:26 Eugene Rozenfeld
2023-06-28 6:39 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Eugene Rozenfeld @ 2023-06-27 21:26 UTC (permalink / raw)
To: gcc-patches
cc1, cc1plus, and lto built during STAGEautoprofile need to be built with
debug info since they are used to build target libs. -gtoggle was
turning off debug info for this stage.
create_gcov should be passed prev-gcc/cc1, prev-gcc/cc1plus, and prev-gcc/lto
instead of stage1-gcc/cc1, stage1-gcc/cc1plus, and stage1-gcc/lto when
processing profile data collected while building target libraries.
Tested on x86_64-pc-linux-gnu.
ChangeLog:
* Makefile.in: Remove -gtoggle for STAGEautoprofile
* Makefile.tpl: Remove -gtoggle for STAGEautoprofile
gcc/c/ChangeLog:
* c/Make-lang.in: Pass correct stage cc1 when processing
profile data collected while building target libraries
gcc/cp/ChangeLog:
* cp/Make-lang.in: Pass correct stage cc1plus when processing
profile data collected while building target libraries
gcc/lto/ChangeLog:
* lto/Make-lang.in: Pass correct stage lto when processing
profile data collected while building target libraries
---
Makefile.in | 2 +-
Makefile.tpl | 2 +-
gcc/c/Make-lang.in | 4 ++--
gcc/cp/Make-lang.in | 4 ++--
gcc/lto/Make-lang.in | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index b559454cc90..61e5faf550f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -635,7 +635,7 @@ STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
-STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
+STAGEautoprofile_CFLAGS = $(filter-out -gtoggle,$(STAGE2_CFLAGS)) -g
STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
diff --git a/Makefile.tpl b/Makefile.tpl
index 6bcee3021c9..3a5b7ed3c92 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -558,7 +558,7 @@ STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
-STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
+STAGEautoprofile_CFLAGS = $(filter-out -gtoggle,$(STAGE2_CFLAGS)) -g
STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in
index 20840aceab6..79bc0dfd1cf 100644
--- a/gcc/c/Make-lang.in
+++ b/gcc/c/Make-lang.in
@@ -113,10 +113,10 @@ create_fdas_for_cc1: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=cc1_$$component_in_prev_target.fda; \
- $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../prev-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
fi; \
done;
-#
+#
# Build hooks:
c.info:
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index c08ee91447e..ba5e8766e99 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -211,10 +211,10 @@ create_fdas_for_cc1plus: ../stage1-gcc/cc1plus$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=cc1plus_$$component_in_prev_target.fda; \
- $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../prev-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
fi; \
done;
-#
+#
# Build hooks:
c++.all.cross: g++-cross$(exeext)
diff --git a/gcc/lto/Make-lang.in b/gcc/lto/Make-lang.in
index 4f6025100a3..98aa9f4cc39 100644
--- a/gcc/lto/Make-lang.in
+++ b/gcc/lto/Make-lang.in
@@ -130,7 +130,7 @@ create_fdas_for_lto1: ../stage1-gcc/lto1$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=lto1_$$component_in_prev_target.fda; \
- $(CREATE_GCOV) -binary ../stage1-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../prev-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
fi; \
done;
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix collection and processing of autoprofile data for target libs
2023-06-27 21:26 [PATCH] Fix collection and processing of autoprofile data for target libs Eugene Rozenfeld
@ 2023-06-28 6:39 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-06-28 6:39 UTC (permalink / raw)
To: Eugene Rozenfeld; +Cc: gcc-patches
On Tue, Jun 27, 2023 at 11:31 PM Eugene Rozenfeld via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> cc1, cc1plus, and lto built during STAGEautoprofile need to be built with
> debug info since they are used to build target libs. -gtoggle was
> turning off debug info for this stage.
>
> create_gcov should be passed prev-gcc/cc1, prev-gcc/cc1plus, and prev-gcc/lto
> instead of stage1-gcc/cc1, stage1-gcc/cc1plus, and stage1-gcc/lto when
> processing profile data collected while building target libraries.
>
> Tested on x86_64-pc-linux-gnu.
OK.
Thanks,
Richard.
> ChangeLog:
>
> * Makefile.in: Remove -gtoggle for STAGEautoprofile
> * Makefile.tpl: Remove -gtoggle for STAGEautoprofile
>
> gcc/c/ChangeLog:
>
> * c/Make-lang.in: Pass correct stage cc1 when processing
> profile data collected while building target libraries
>
> gcc/cp/ChangeLog:
>
> * cp/Make-lang.in: Pass correct stage cc1plus when processing
> profile data collected while building target libraries
>
> gcc/lto/ChangeLog:
>
> * lto/Make-lang.in: Pass correct stage lto when processing
> profile data collected while building target libraries
> ---
> Makefile.in | 2 +-
> Makefile.tpl | 2 +-
> gcc/c/Make-lang.in | 4 ++--
> gcc/cp/Make-lang.in | 4 ++--
> gcc/lto/Make-lang.in | 2 +-
> 5 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/Makefile.in b/Makefile.in
> index b559454cc90..61e5faf550f 100644
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -635,7 +635,7 @@ STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
> STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
> STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
>
> -STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
> +STAGEautoprofile_CFLAGS = $(filter-out -gtoggle,$(STAGE2_CFLAGS)) -g
> STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
>
> STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
> diff --git a/Makefile.tpl b/Makefile.tpl
> index 6bcee3021c9..3a5b7ed3c92 100644
> --- a/Makefile.tpl
> +++ b/Makefile.tpl
> @@ -558,7 +558,7 @@ STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
> STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
> STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
>
> -STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
> +STAGEautoprofile_CFLAGS = $(filter-out -gtoggle,$(STAGE2_CFLAGS)) -g
> STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
>
> STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
> diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in
> index 20840aceab6..79bc0dfd1cf 100644
> --- a/gcc/c/Make-lang.in
> +++ b/gcc/c/Make-lang.in
> @@ -113,10 +113,10 @@ create_fdas_for_cc1: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA)
> echo $$perf_path; \
> if [ -f $$perf_path ]; then \
> profile_name=cc1_$$component_in_prev_target.fda; \
> - $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
> + $(CREATE_GCOV) -binary ../prev-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
> fi; \
> done;
> -#
>
> +#
> # Build hooks:
>
> c.info:
> diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
> index c08ee91447e..ba5e8766e99 100644
> --- a/gcc/cp/Make-lang.in
> +++ b/gcc/cp/Make-lang.in
> @@ -211,10 +211,10 @@ create_fdas_for_cc1plus: ../stage1-gcc/cc1plus$(exeext) ../prev-gcc/$(PERF_DATA)
> echo $$perf_path; \
> if [ -f $$perf_path ]; then \
> profile_name=cc1plus_$$component_in_prev_target.fda; \
> - $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
> + $(CREATE_GCOV) -binary ../prev-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
> fi; \
> done;
> -#
>
> +#
> # Build hooks:
>
> c++.all.cross: g++-cross$(exeext)
> diff --git a/gcc/lto/Make-lang.in b/gcc/lto/Make-lang.in
> index 4f6025100a3..98aa9f4cc39 100644
> --- a/gcc/lto/Make-lang.in
> +++ b/gcc/lto/Make-lang.in
> @@ -130,7 +130,7 @@ create_fdas_for_lto1: ../stage1-gcc/lto1$(exeext) ../prev-gcc/$(PERF_DATA)
> echo $$perf_path; \
> if [ -f $$perf_path ]; then \
> profile_name=lto1_$$component_in_prev_target.fda; \
> - $(CREATE_GCOV) -binary ../stage1-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
> + $(CREATE_GCOV) -binary ../prev-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
> fi; \
> done;
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-28 6:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-27 21:26 [PATCH] Fix collection and processing of autoprofile data for target libs Eugene Rozenfeld
2023-06-28 6:39 ` Richard Biener
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).