https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63472
--- Comment #7 from Benjamin Braun <bjmnbraun at gmail dot com> --- A workaround for the code at the top of this thread is to wrap the transaction in the loop with a function and instead call that function from the loop. This workaround also works for the case given in duplicate filing https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64879, however the wrapper function has to be marked __attribute__((noinline)) otherwise the function gets inlined and then the workaround fails.