https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121038

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I experimented with smaller sampling period and indeed create_gcov then runs
out of memory. On my setup create_gcov was simply segfaulting and produced just
partial profile.  Since Makefile does not fail on crate_gcov returning
non-zero, and since profmerger does not error either on truncated profile
files, my combined profile ended up missing many samples.

diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in
index 2517b64439f..b7936c9014f 100644
--- a/gcc/c/Make-lang.in
+++ b/gcc/c/Make-lang.in
@@ -101,7 +102,8 @@ 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.fda; \
-           $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov
$$profile_name -profile $$perf_path -gcov_version 2; \
+           echo $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov
$$profile_name -profile $$perf_path -gcov_version 2 ; \
+           $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov
$$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \
          fi; \
        done;

@@ -111,7 +113,8 @@ 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 ../prev-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 || exit 1; \
          fi; \
        done;

diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index dae3c6846e0..6f9deebbac9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -123,6 +123,8 @@ CXX_OBJS = cp/cp-lang.o c-family/stub-objc.o 
@@ -199,7 +201,7 @@ 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.fda; \
-           $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov
$$profile_name -profile $$perf_path -gcov_version 2; \
+           $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov
$$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \
          fi; \
        done;

@@ -209,7 +212,7 @@ 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 ../prev-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 || exit 1; \
          fi; \
        done;

jh@a

Reply via email to