This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Vector return on ARM
On May 12, 2005, at 6:21 AM, Julian Brown wrote:
Paul Brook wrote:
On Thursday 12 May 2005 01:57, Julian Brown wrote:
Julian Brown wrote:That sounds strange. There used to be a similar bug relating to
thumb interworking, but I though I'd fixed that...
Andrew Pinski wrote:
On May 11, 2005, at 8:13 PM, Julian Brown wrote:
This patch corrects returning vectors from functions on ARM, both
with the classic APCS and the new AAPCS. Vectors of word-size
are returned in r0, and larger vectors are returned in memory.
Previously, vector values were always returned in registers,
sometimes caused wrong code (on arm-none-elf) and sometimes
both arm-none-elf and arm-none-eabi.
This is the same as the patch which Josh Conner posted?
It's functionally identical, by the looks of it. Sorry for the
...except for the wrong-code case I saw on arm-none-elf, I think.
patch tries to retain backward compatibility with the legacy ABI,
is probably the right thing to do, but this apparently exposes a
epilogue generation which manifests at -O0 with, e.g.,
g++.dg/ext/attribute-test-1.C. A four-register vector is returned
constructor in r0-r3, but the epilogue clobbers r3. I'm not sure
but I suspect it's transferring an extra register to preserve stack
alignment, or something.
My patch kills backward compatibility by returning only vectors <= 4I think I prefer Josh's patch.
*bytes* (not words) in registers, but generates correct code for the
case mentioned above. Given that vector return in registers probably
doesn't always work anyway at the moment, maybe this is a better
If r3 is clobbered in the epilogue returning of complex double
types is probably similarly broken, so it needs fixing anyway.
The patch is merely preserving existing behaviour. It's shouldn't
introduce any new failures.
Patch is ok if Julian can confirm it doesn't break anything new.
Yes, Josh's patch doesn't break anything new, it just doesn't fix
that particular vector return bug. I'll see if I can figure out
what's going on with that.
This code in output_return_instruction() is making r3 be restored
/* If we can't use ldmib (SA110 bug),
then try to pop r3 instead. */
live_regs_mask |= 1 << 3;