https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85459
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 Status|UNCONFIRMED |NEW Last reconfirmed| |2018-12-20 CC| |rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- So it's if (TREE_CODE (ref) != MEM_REF || TREE_CODE (TREE_OPERAND (ref, 0)) != ADDR_EXPR) return false; tree mem = TREE_OPERAND (TREE_OPERAND (ref, 0), 0); if (TYPE_MAIN_VARIANT (TREE_TYPE (ref)) != TYPE_MAIN_VARIANT (TREE_TYPE (mem))) return true; specifically the TYPE_MAIN_VARIANT check. This is probably too conservative given it labels writing a.i as MEM[&a + 4] as VCE. I wonder if for the purpose of total scalarization we can ignore VCEs on aggregate copies in case we do not need to re-materialize the thing? Not having looked at the actual testcase here but guessing from the testcase added by the above change and memcpy inlining now generating char[] typed load/stores this is what prevents total scalarization in too many cases.