https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61762
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 33218 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33218&action=edit patch I have a patch but as the relevant folding already triggers during C parsing it is too early for the cgraph code to see the constant initializer ... (well, on x86_64). But well, all this memory builtin folding should move to GIMPLE anyway... Patch attached, it may still help SPARC passing the testcase. (side-note - instead of the current fold_constant_aggregate_ref I'd like to see a fold_constant_read (type, ptr) API that is, not require us building a memory reference)