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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The problem is in
Breakpoint 3, validate_subreg (omode=omode@entry=E_QImode, imode=E_HImode,
reg=reg@entry=0x7ffff6c80cf0, offset=...) at […]/gcc/emit-rtl.cc:925

for:

992       /* Ensure that subregs of hard registers can be folded.  In other
words,
993          the hardware register must be valid in the subreg's outer mode,
994          and consequently the subreg can be replaced with a hardware
register.  */
995       if (reg && REG_P (reg) && HARD_REGISTER_P (reg))
996         {
997           unsigned int regno = REGNO (reg);
998
999           if ((COMPLEX_MODE_P (imode) || VECTOR_MODE_P (imode))
1000              && GET_MODE_INNER (imode) == omode)
1001            ;
1002          else if (!REG_CAN_CHANGE_MODE_P (regno, imode, omode))
1003            return false;

at

#0  validate_subreg (omode=omode@entry=E_QImode, imode=<optimized out>,
reg=reg@entry=0x7ffff6c80cf0, offset=...) at
/net/vbuild-02/srv/data/tburnus/repos/gcc/gcc/emit-rtl.cc:1002
1002          else if (!REG_CAN_CHANGE_MODE_P (regno, imode, omode))

(gdb) p omode
$11 = E_QImode

(gdb) p regno
$12 = 0

(gdb) p imode
$10 = <optimized out>

which can be determined via:

1062      gcc_assert (validate_subreg (mode, GET_MODE (reg), reg, offset));

(gdb) p debug(reg)
(reg:HI 0 %value)
$13 = void

Reply via email to