A reproducer: $ /export/users/haochenj/env/build_no_bootstrap_master/gcc/xgcc -B/export/users/haochenj/env/build_no_bootstrap_master/gcc/ /export/users/haochenj/src/gcc/master/gcc/testsuite/gcc.target/i386/pr80969-4a.c -m64 -DDEBUG -fdiagnostics-plain-output -Ofast -mabi=ms -mavx512f -lm -o ./pr80969-4a.exe $ ./pr80969-4a.exe Segmentation fault (core dumped) After I debug into that, where it core dumped is the "printf ("PASSED\n");" in avx-check.h. We got: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7db887c in __strlen_evex () from /lib64/libc.so.6 It seems that the seg fault will only happen under -mabi=ms. If we eliminate -mabi=ms, no segmentation fault is detected.
This is NOT a bug as -mabi=ms changes the ABI of all of the function calls including extern ones. Basically if you mark printf as having the GNU ABI, then it would work.