https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212
--- Comment #48 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #47)
> Created attachment 33615 [details]
> reduced CSiBE /libpng-1.2.5 test
>
> I've tried compiling CSiBE (-m4 -ml). This is a stripped down pngrutil.c
> which crashes in lra-spills.c (remove_pseudos).
> It's a bit strange, because if the function 'test' (top of the file) is
> compiled before the actual problematic function 'png_handle_cHRM', there's a
> segfault.
The segfault happens because of this lookup (remove_pseudos):
if ((hard_reg = spill_hard_reg[i]) != NULL_RTX)
The array at i = 699 doesn't seem to contain anything valid.
Function 'assign_spill_hard_regs' sets those values:
spill_hard_reg[regno]
= gen_raw_REG (PSEUDO_REGNO_MODE (regno), hard_regno);
However, in this case it never gets to it because of this:
if (! lra_reg_spill_p)
return n;