https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90271
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Component|rtl-optimization |tree-optimization --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Well, very early in GIMPLE we end up with <bb 2> : v1 = 3; MEM[(char * {ref-all})&v1 + 1B] = 1; _9 = v1; v1 ={v} {CLOBBER}; return _9; this means what we are looking for is store-merging handling this case (albeit that runs quite late). The extra complication there is likely the fact that the memcpy changes the effective type of v1 and to preserve TBAA correctness for the combined store we'd have to use a conservative alias-set for the combined store (read: zero). In an ideal world value-numbering would figure all this out of course ;) Is the example from real-world code? Just asking to see whether this is an important case to handle.