https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125366
--- Comment #21 from Sam James <sjames at gcc dot gnu.org> --- (In reply to Michal Kowalewski from comment #20) > (In reply to Sam James from comment #19) > > (In reply to Michal Kowalewski from comment #18) > > > (In reply to Sam James from comment #14) > > > > (In reply to Michal Kowalewski from comment #12) > > > > > compare-lto still fails, and the files seem identical (since I've > > > > > already > > > > > built them with stripped with -s). I also tried bootstrapping with > > > > > the same > > > > > flags on another machine with AMD 7950X where -march=native expands to > > > > > znver4, and surprisingly, more objects failed the comparison: > > > > > > > > > > ... > > > > > > > > > > So the -march switch does affect this bug. I am including > > > > > gimple-match-5 > > > > > objects from the zen 4 build. > > > > > > > > Could you please pick the smallest of the relevant objects, then for the > > > > matching command lines, share those, then run one of them with > > > > -save-temps, > > > > and upload xyz.ii for preprocessed source? > > > > > > > > You can then try whittle down which flag causes a difference too when > > > > both > > > > are built with the same flags. > > > > > > I rebuilt everything with -g0 on both alderlake and zen 4, and the results > > > are rather surprising. > > > > Thanks (though I wasn't saying to rebuild everything). > > > > > All but gimple-match-6 diffs have disappeared. I have > > > included stage2 and stage3 objects, with preprocessed sources as split 7z > > > archive (due to size). All artifacts are from my znver4 build. So > > > disabling > > > debug info does indeed affect this bug, however gimple-match-6.o still > > > remains. All sources were compiled with "-O3 -march=znver4 -flto > > > -flto-partition=none -ftrivial-auto-var-init=uninitialized > > > -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition > > > -fno-plt -s -fno-ident -fno-asynchronous-unwind-tables -g0" > > > > Can you narrow down which of the flags for stage2 and stage3 (changing them > > both at the same time) causes a difference when rebuilding just > > gimple-match-6? > > I was not able to reduce it any further. With baseline -O2 -flto -g0 the > bootstrap comparison still fails. The bug is highly unpredictable, as after > full rebuild with these flags, the insn_recog.o failed the comparison, while > gimple-match.o did not. The bug also seems to be unrelated to > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111768 since I have reproduced > it both on znver4 (which does have homogeneous cores) and even on baseline > x86-64. There are two different things: 1) Minimising the flags required to build GCC s.t. it miscompares, and 2) Minimising the flags for a built GCC in stage 2 + stage3 that when executed does something else. 1) is about GCC being miscompiled, 2) is about debugging how it is miscompiled.
