https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119085
--- Comment #4 from Po Lu <luangruo at yahoo dot com> --- "rguenth at gcc dot gnu.org" <gcc-bugzi...@gcc.gnu.org> writes: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119085 > > Richard Biener <rguenth at gcc dot gnu.org> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Ever confirmed|0 |1 > CC| |rguenth at gcc dot gnu.org > Priority|P3 |P2 > Status|UNCONFIRMED |NEW > Last reconfirmed| |2025-03-02 > > --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- > Total scalarization of a union looks dubious unless it uses ref-all and of > course copies the whole storage. The union type is never considered at all because the access to the union is of the same size as an access to a member struct, which struct was defined first and therefore sorts before the union, with the result that the former access is excluded by this loop in sort_and_splice_var_accesses: j = i + 1; while (j < access_count) { struct access *ac2 = (*access_vec)[j]; if (ac2->offset != access->offset || ac2->size != access->size) break; [...] ac2->group_representative = access; j++; } i = j;