http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54342
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|rtl-optimization |target Target Milestone|4.8.0 |--- Summary|[4.8 Regression] Wrong mode |OImode is used for _m256 |of call argument |types when using unions in | |a function call. --- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-11-16 22:58:46 UTC --- >(insn 10 9 11 3 (set (reg:OI 21 xmm0) (reg:OI 64)) er.c:14 -1 (nil)) This above is generated by the back-end's call by construct_container. So this is not a middle-end issue even if the middle-end says the mode on the union is BLKmode. It is up to the back-end to do the correct thing when it is doing a function call and converting the BLKmode of the union to the correct mode. case 4: gcc_assert (i == 0 && regclass[1] == X86_64_SSEUP_CLASS && regclass[2] == X86_64_SSEUP_CLASS && regclass[3] == X86_64_SSEUP_CLASS); tmpmode = OImode; Is where the OImode is being generated. The comment in ix86_hard_regno_mode_ok says: /* We implement the move patterns for all vector modes into and out of SSE registers, even when no operation instructions are available. OImode move is available only when AVX is enabled. */ So really I don't think this is a bug in the code itself but rather the patch which you are working on which did not take into account OImode being an AVX mode.