https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91859
--- Comment #5 from Joseph C. Sible <josephcsible at gmail dot com> --- The real problem mentioned in comment 2 still happens as of GCC 11.1. I've narrowed it down somewhat to the optimization flags "-Og -ftree-dse -ftree-pta". Removing any one of those will make it behave again.