https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90271
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2019-04-28 Ever confirmed|0 |1 Severity|normal |enhancement --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- memcpy optimization happens only when expanding from Gimple to RTL and we don't remove "stack" locations after RTL. I Have some idea on how to solve this. Use VCE to convert to the same size integer (if it exists) and then use BIT_FIELD_REF to extract the value, note we to deal with big vs little endian (as BIT_FIELD_REF is depdent on that).