https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104777
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work|8.5.0 |8.1.0, 8.3.0
Known to fail| |8.4.0, 8.5.0
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note loop being a thread_local (__thread) is important here to get the crash.
Further reduced testcase:
int savestate_r;
int savestate_ssb;
extern void abort();
__thread int loop;
void f (void)
{
int savestate_r0_5;
int savestate_r1_6;
__asm__("" : "=m" (savestate_ssb), "=r" (savestate_r));
savestate_r0_5 = savestate_r;
if (savestate_r0_5 == 0)
{
__asm__ __volatile__("" : : "m" (loop));
abort ();
}
__asm__("" : "=m" (savestate_ssb), "=r" (savestate_r));
savestate_r1_6 = savestate_r;
if (savestate_r1_6 != 0)
return;
__asm__ __volatile__("" : : "m" (loop));
abort ();
}