This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/2] MIPS/GAS: Fix o32 LD to the base register
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Maciej W. Rozycki" <macro at linux-mips dot org>
- Cc: binutils at sourceware dot org
- Date: Mon, 18 Oct 2010 08:47:49 +0100
- Subject: Re: [PATCH 1/2] MIPS/GAS: Fix o32 LD to the base register
- References: <alpine.LFD.2.00.1010130023180.15889@eddie.linux-mips.org>
"Maciej W. Rozycki" <macro@linux-mips.org> writes:
> Here's another one:
>
> $ cat ld-base.s
> ld $4, ($4)
> $ mips-linux-as -o ld-base.o ld-base.s
> $ mips-linux-objdump -d ld-base.o
>
> ld-base.o: file format elf32-tradbigmips
>
>
> Disassembly of section .text:
>
> 00000000 <.text>:
> 0: 8c840000 lw a0,0(a0)
> 4: 00000000 nop
> 8: 8c850004 lw a1,4(a0)
>
> Ouch!
>
> Fixed thus and regression tested for mips-linux, mips64-linux,
> mipstx39-elf, mipsisa64-elf and mips-ecoff targets and their little-endian
> counterparts. The new code produced looks like this:
>
> $ mips-linux-objdump -d ld-base.o
>
> ld-base.o: file format elf32-tradbigmips
>
>
> Disassembly of section .text:
>
> 00000000 <.text>:
> 0: 00800821 move at,a0
> 4: 8c240000 lw a0,0(at)
> 8: 8c250004 lw a1,4(at)
Why are you doing it this way, rather than reversing the loads?
Seems a shame to use $at when we don't need to.
Richard