https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109493
--- Comment #4 from Mikhail Mitskevich <mitskevichmn at gmail dot com> --- (In reply to Andrew Pinski from comment #1) > belt_mac_st* st = &state; > belt_mac_st* st2 = &state2; > ((word*)(st->s))[0] = 0, ((word*)(st->s))[1] = 0; > ((word*)(st->r))[0] = 0, ((word*)(st->r))[1] = 0; > st->filled = 0; > > I am 99% sure those are aliasing rule violations. > > Does -fno-strict-aliasing help? With -fno-strict-aliasing option code works as well as with -O1 option.