******************************************************************************* OS and Platform: CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux ******************************************************************************* Program: int a=2; static int b(int *c) { (0 >= *c) & (a--); return 0; } int main() { int d=0; b(&d); } ******************************************************************************* gcc version: $ gcc -v Using built-in specs. COLLECT_GCC=/home/suocy/bin/gcc-dev/bin/gcc COLLECT_LTO_WRAPPER=/home/suocy/bin/gcc-dev/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/suocy/bin/gcc-dev/ --disable-multilib --enable-languages=c,c++ Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20201124 (experimental) (GCC) ******************************************************************************* Command Lines: $ gcc -Wall -Wextra -fno-strict-aliasing -fwrapv -O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp a.c a.c: In function ‘b’: a.c:2:34: warning: value computed is not used [-Wunused-value] 2 | static int b(int *c) { (0 >= *c) & (a--); return 0; } | ~~~~~~~~~~^~~~~~~ a.c: In function ‘b.constprop.isra’: a.c:2:30: warning: ‘c’ is used uninitialized [-Wuninitialized] 2 | static int b(int *c) { (0 >= *c) & (a--); return 0; } | ^~ $ ./a.out Segmentation fault
I think it is due to -fno-tree-dce .
Started with r10-3311-gff6686d2e5f797d6.
This is quite clearly a duplicate of PR 93385 (IPA-SRA relies on DCE). Let me try again to come up with a more acceptable patch to fix it. *** This bug has been marked as a duplicate of bug 93385 ***