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

--- Comment #7 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> But then wonder if/how target_reinit works for i?86 32-bit.
> Perhaps pic_offset_table_rtx should be cleared in init_emit_regs before
> computing it?
>   pic_offset_table_rtx = NULL_RTX;
>   if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
>     pic_offset_table_rtx = gen_raw_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);

Adding the line:
    pic_offset_table_rtx = NULL_RTX;
does indeed fix the issue; with that (or with my patch from comment #2) the jit
testsuite fully passes on i686.

I was hoping to keep the patch confined to toplev::finalize, since only the jit
calls this, reducing the scope of the proposed change, but if you think it's
better to have it in init_emit_regs, I'll defer to your judgement.

Reply via email to