This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: MIPS patch to avoid lazy binding in la macros
Eric Christopher <echristo at redhat dot com> writes:
> > Hmm. I see you're responding to my first message. As I said
> > in a follow-up, I think we should stop gcc splitting the jal
> > macro in final. Sound reasonable?
> >
>
> That's not a bad idea.
>
> Another one is to have rewrite produce the instruction sequence
> (including relocs) that would be emitted by gas and we could go back and
> leave la alone. I don't much like this, but it is an idea that would
> help the assembly language programmers.
Yeah, the explicit reloc case should work OK. The problem is the
"legacy" (?) macro support (!TARGET_EXPLICIT_RELOCS). The new
register constraint for call addresses ('c') only allows $25
for TARGET_ABICALLS. So instead of:
la $2,foo
beqz $2,1f
move $25,$2
jal $25
1:
we get:
la $25,foo
beqz $25,1f
jal $25
1:
The point is, most "recent" gcc versions could emit the second
sequence as well. They only avoid it by chance. I really think
this is a correctness issue for all gccs, not just the
rewrite branch.
Richard