This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Thumb PIC problems
- To: Dmitry Pugachev <dima_p at auriga dot ru>
- Subject: Re: Thumb PIC problems
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Mon, 30 Oct 2000 14:23:29 +0000
- Cc: gcc at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
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
>
>