This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix PR44169, load_toc_v4_PIC_1b
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 2 Jun 2010 09:07:21 -0400
- Subject: Re: Fix PR44169, load_toc_v4_PIC_1b
- References: <20100531065710.GE5631@bubble.grove.modra.org>
On Mon, May 31, 2010 at 2:57 AM, Alan Modra <amodra@gmail.com> wrote:
> load_toc_v4_PIC_1b is an unspec that sets lr to the location of a word
> containing a pc-relative _GLOBAL_OFFSET_TABLE_ address. ?Currently
> the rtl doesn't contain anything that says the output depends on pc,
> so gcc is free to combine two occurrences of this insn. ?At one stage
> in gcc's history, the entire sequence of insns using this one to set
> up the got pointer was marked with REG_LIBCALL/REG_RETVAL notes. ?When
> optimizing, gcc used to combine the entire sequence with a previous
> sequence, but at -O1 we now emit wrong code.
>
> Fixed by adding a label to the rtl. ?Bootstrapped and regression
> tested powerpc-linux. ?OK mainline and branches?
>
> ? ? ? ?PR target/44169
> ? ? ? ?* config/rs6000/rs6000.md (load_toc_v4_PIC_1b): Add label operand.
> ? ? ? ?* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Pass label
> ? ? ? ?rtx to gen_load_toc_v4_PIC_1b. ?Tidy.
> ? ? ? ?(rs6000_emit_load_toc_table): Likewise.
Okay.
Thanks, David