https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105260

--- Comment #8 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #7)
> Or find out why SRA doesn't optimize this (remove the useless union, replace
> all the un.value occurrences with a var with Foo type.

IIUC, it just isn't profitable, SRA sees:

  un.value = D.2545;
  dummyFunc (MEM[(const struct Foo &)&un]);
  un ={v} {CLOBBER(eol)};

and it just cannot avoid ultimately setting up the structure and pass
it to dummyFunc (IPA-SRA does not control that function and so cannot
change it).

Reply via email to