[Bug middle-end/124583] wrong code at -O2 when compiling with PGO on x86_64-pc-linux-gnu
xintong.zhou1 at uwaterloo dot ca
gcc-bugzilla@gcc.gnu.org
Sun Mar 22 18:05:52 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124583
--- Comment #2 from Xintong Zhou <xintong.zhou1 at uwaterloo dot ca> ---
(In reply to Richard Biener from comment #1)
> Hmm, can't reproduce.
Hi, it still reproduces on the latest version on my end.
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/data/x27zhou/compiler-nightly/install/gcc/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /data/x27zhou/compiler-nightly/src/gcc/configure
--enable-checking=yes --disable-bootstrap --disable-multilib
--enable-languages=c,c++ --prefix=/data/x27zhou/compiler-nightly/install/gcc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260322 (experimental) (GCC)
$
$ gcc-trunk -O2 -fprofile-use -Wno-coverage-mismatch small.c && ./a.out
0
$ gcc-trunk -O2 small.c && ./a.out
2
Btw, gcov-dump shows the profile as:
$ gcov-dump -l -p a-small.gcda
a-small.gcda:data:magic `gcda':version `B60 '
a-small.gcda:stamp 73902325
a-small.gcda:checksum 2429308459
a-small.gcda: 16: a1000000: 8:OBJECT_SUMMARY runs=1, sum_max=1024
a-small.gcda: 32: 01000000: 12:FUNCTION ident=721827547,
lineno_checksum=0x8c624c09, cfg_checksum=0x73ff2042
a-small.gcda: 52: 01a10000: 24:COUNTERS arcs 3 counts
a-small.gcda: 84: 0: 3579999111 0 0
What's the output on your end?
More information about the Gcc-bugs
mailing list