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

            Bug ID: 126153
           Summary: [csmith] runtime crash with -O3
                    -ftrivial-auto-var-init=zero
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 64956
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64956&action=edit
C source code

The attached C code from csmith does this with recent gcc:

foundBugs $  ~/gcc/results/bin/gcc -w -O2  bug1227.c && ./a.out
checksum = 2812A2BF
foundBugs $  ~/gcc/results/bin/gcc -w -O3  bug1227.c && ./a.out
checksum = 2812A2BF
foundBugs $  ~/gcc/results/bin/gcc -w -O3 -ftrivial-auto-var-init=zero 
bug1227.c && ./a.out
Segmentation fault         (core dumped) ./a.out
foundBugs $ 

The bug first seems to occur sometime between 12.1 and 13.1:

foundBugs $ for i in ~/gcc/results.1*/bin/gcc; do echo $i; $i -w -O3
-ftrivial-auto-var-init=zero bug1227.c; ./a.out; done
/home/dcb42/gcc/results.12.1.0/bin/gcc
checksum = 2812A2BF
/home/dcb42/gcc/results.13.1.0/bin/gcc
Segmentation fault         (core dumped) ./a.out
foundBugs $

The compiler is:

foundBugs $  ~/gcc/results/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/home/dcb42/gcc/results/bin/gcc
COLLECT_LTO_WRAPPER=/home/dcb42/gcc/results.20260707.asan.ubsan/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../trunk/configure
--prefix=/home/dcb42/gcc/results.20260707.asan.ubsan --disable-bootstrap
--disable-doc --disable-multilib --with-build-config='bootstrap-asan
bootstrap-ubsan' --with-pkgversion=1bc69a001cc149f0 --enable-checking=yes
--enable-languages=c,c++,fortran
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260707 (experimental) (1bc69a001cc149f0) 
foundBugs $

Reply via email to