Thumb PIC problems
Richard Earnshaw
rearnsha@arm.com
Mon Oct 30 06:24:00 GMT 2000
PIC Thumb code isn't currently supported to the best of my knowledge.
Sorry,
Richard.
> Hi! I have a question concerning the PIC support for Thumb. Well, it's
> not Thumb-specific, but I encountered it while trying to compile Thumb
> code. There (in thumb.c) is a definition for the PIC register to be r10
> (sl), and, being a high register, it cannot be directly loaded with a
> memory content (_GLOBAL_OFFSET_TABLE_ reference). But the
> thumb_finalize_pic() function emits such a load, and I thought that the
> reload phaze should split that insn to use a temporary low register for
> the transfer. But it does not (because it won't split hard register
> moves?). I wonder, what is the correct way to make it use a temporary
> reg? I tried to replace the direct load with the following code:
>
> {
> rtx r = gen_reg_rtx (Pmode);
> emit_insn (gen_pic_load_addr (r, pic_rtx));
> emit_move_insn (pic_offset_table_rtx, r);
> }
>
> but it had no effect as the two instructions were collapsed into one,
> producing the incorrect load.
> Inserting emit_insn (gen_rtx_USE (VOIDmode, r)) between them helps, but
> is it the correct fix?...
>
> Thanks in advance.
>
> /Dmitry
>
>
More information about the Gcc
mailing list