On Thu, Jun 24, 2021 at 12:13:18PM +0200, Richard Biener wrote:
> > The recent addition of gcc_assert (regno < endregno); triggers during
> > glibc build on m68k.
> > The problem is that RA decisions shouldn't depend on expressions in
> > DEBUG_INSNs and those expressions can contain paradoxical subregs of certain
> > pseudos.  If RA then decides to allocate the pseudo to a register
> > with very small hard register REGNO, we can trigger the new assert,
> > as (int) subreg_regno_offset may be negative on big endian and the small
> > REGNO + the negative offset can wrap around.
> 
> Hm, I wonder if we should reset the debug_insn if the RA made a decision
> that produces such non-sensical result for a debug_insn use?

For debug info purposes it isn't necessarily invalid.
If we extract later on only the well defined bits from the paradoxical
subreg (e.g. by using a lowpart subreg of the debug expr), or AND it with
a constant mask that only contains bits on the low part positions, then it
is fine.  And otherwise, it is useless for debug info anyway, we can't
express that in DWARF (low bits set to ..., high bits undefined) - there
the whole thing would be undefined.

        Jakub

Reply via email to