https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51506
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 60570 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60570&action=edit C23 testcase This testcase is similar to what is done for AVR (minus an extra copy which I have a patch for but even with that copy removed we does not optimize it). So the IPA passes don't look into const static aggregates. Note the reason why you need C23 is because that added the ability for static compound literals (you could make a C99 testcase but I was lazy).