https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105711
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. We are expanding
MEM <vector(2) char> [(char *)&c] = { 0, 0 };
with 'c' expanded as
(concat:CQI (reg/v:QI 93 [ c ])
(reg/v:QI 94 [ c+1 ]))
doing read_complex_part from
(subreg:CQI (const_vector:V2QI [
(const_int 0 [0]) repeated x2
]) 0)
which is a) a missed subreg simplification (do we have const complex in RTL?).
We get into extract_bit_field_1 which eventually does
/* Make sure we are playing with integral modes. Pun with subregs
if we aren't. */
opt_scalar_int_mode op0_mode = int_mode_for_mode (GET_MODE (op0));
scalar_int_mode imode;
if (!op0_mode.exists (&imode) || imode != GET_MODE (op0))
{
if (MEM_P (op0))
op0 = adjust_bitfield_address_size (op0, op0_mode.else_blk (),
0, MEM_SIZE (op0));
else if (op0_mode.exists (&imode))
{
op0 = gen_lowpart (imode, op0);
getting us a HImode (const_int 0 [0]) as op0. But extract_bit_field_as_subreg
which eventually ICEs only gets op0 but not its mode ...
I'm testing a patch.