https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121044
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jan Palus from comment #2) > Some weird observations from reproducer minimazation: > - memcpy() needs to be there otherwise it's not reproduced (although it's > completely unrelated?) Without the memcpy, the tmp is unused and can be optimized away. > - memcpy() needs to copy into array which is struct's member. plain array > does not trigger issue > - struct with array member needs to be passed as function argument Most likely because the memcpy becomes unused and tmp becomes unused and all optimized away early on. Gcc has some decent DSE for local arrays that are only written to and not read from..