Hi! On Thu, Oct 10, 2019 at 03:16:36PM -0700, Jim Wilson wrote: > This addresses PR 91860 which has four testcases triggering internal errors. > The problem here is that in combine when handling debug insns, we are trying > to substitute > (sign_extend:DI (const_int 8160 [0x1fe0])) > as the value for > (reg:DI 78 [ _9 ]) > in the debug insn > (debug_insn 29 28 30 2 (var_location:QI d (subreg:QI (reg:DI 78 [ _9 ]) 0)) > "tmp4.c":11:5 -1 > (nil)) > This eventually triggers an abort because 8160 is not a sign-extended > QImode value. > > We should avoid creating the invalid RTL in the first place.
It is *normal* for combine to create invalid RTL. It first creates it, and it checks if it is valid later. However: > In subst there > is already code to avoid putting a CONST_INT inside a ZERO_EXTEND. This > needs to be extended to also handle a SIGN_EXTEND the same way. That works, sure. Approved for trunk. Thanks! Segher