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

            Bug ID: 111663
           Summary: profiledbootstrap fails on master:
                    gcc/genmodes.cc:2152:1: error:
                    ‘gcc/build/genmodes.gcda’ profile count data file not
                    found [-Werror=missing-profile]
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

It is the same issue diagnosed by Martin in https://gcc.gnu.org/PR87932#c2

The only difference here is the failure of profiledbootstrap on master by
default (until you disable -Werror).

The reproducer:

    $ ~/dev/git/gcc/configure --disable-multilib --enable-languages=c,c++
CC='gcc -O2' CXX='g++ -O2'
    $ make profiledbootstrap

    ...
gcc/gcc/sort.cc: In function ‘void reorder45(sort_ctx*, char*, char*, char*,
char*, char*) [with sort_ctx = sort_r_ctx]’:
gcc/gcc/sort.cc:313:1: error: ‘gcc/build/sort.gcda’ profile count data file not
found [-Werror=missing-profile]
  313 | }
      | ^
gcc/gcc/genmodes.cc: In function ‘int main(int, char**)’:
gcc/gcc/genmodes.cc:2152:1: error: ‘gcc/build/genmodes.gcda’ profile count data
file not found [-Werror=missing-profile]
 2152 | }
      | ^
gcc/gcc/gengtype-parse.cc: In function ‘void parse_file(const char*)’:
gcc/gcc/gengtype-parse.cc:1186:1: error: ‘gcc/build/gengtype-parse.gcda’
profile count data file not found [-Werror=missing-profile]
 1186 | }
      | ^
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2949: build/gengenrtl.o] Ошибка 1
gcc/gcc/gengtype-parse.cc: In function ‘void parse_error(const char*, ...)’:
gcc/gcc/gengtype-parse.cc:142:21: error: ‘%s’ directive argument is null
[-Werror=format-overflow=]
  142 |   fprintf (stderr, "%s:%d: parse error: ",
      |                     ^~

Stable branches work just because -Werror is disabled.

Note that autofeedback has a similar problem and it works it around with
disabling -Werror:

 # Disable warnings as errors since inlining decisions with -fauto-profile
 # may result in additional warnings.
 STAGEautofeedback_CONFIGURE_FLAGS = $(filter-out
--enable-werror-always,$(STAGE_CONFIGURE_FLAGS))

I suggest doling the same for `profiledbootstrap` as:

--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -561,6 +561,10 @@ STAGEtrain_TFLAGS = $(filter-out
-fchecking=1,$(STAGE3_TFLAGS))

 STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
-fprofile-reproducible=parallel-runs
 STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
+# Disable warnings as errors for a few reasons:
+# - sources for gen* binaries do not have .gcda files available
+# - inlining decisions generate extra warnings
+STAGEfeedback_CONFIGURE_FLAGS = $(filter-out
--enable-werror-always,$(STAGE_CONFIGURE_FLAGS))

 STAGEautoprofile_CFLAGS = $(filter-out -gtoggle,$(STAGE2_CFLAGS)) -g
 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)

Reply via email to