https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585
--- Comment #6 from Hector Martin <hector at marcansoft dot com> --- Cleaned it up into a self-contained repro. Simply compiling with `gcc -O2 -o test test.c && test` gives a segfault. -O1 or -fno-schedule-insns -fno-schedule-insns2 avoids the issue. Looking at assembly output on godbolt, it seems this likely goes at least as far back as 11.1 if not earlier.