This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Vector return on ARM

Paul Brook wrote:
On Thursday 12 May 2005 01:57, Julian Brown wrote:

Julian Brown wrote:

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 or less
are returned in r0, and larger vectors are returned in memory.
Previously, vector values were always returned in registers, which
sometimes caused wrong code (on arm-none-elf) and sometimes ICEd on
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 noise!

...except for the wrong-code case I saw on arm-none-elf, I think. Josh's patch tries to retain backward compatibility with the legacy ABI, which is probably the right thing to do, but this apparently exposes a bug in epilogue generation which manifests at -O0 with, e.g., g++.dg/ext/attribute-test-1.C. A four-register vector is returned from a constructor in r0-r3, but the epilogue clobbers r3. I'm not sure why, but I suspect it's transferring an extra register to preserve stack alignment, or something.

That sounds strange. There used to be a similar bug relating to thumb interworking, but I though I'd fixed that...

My patch kills backward compatibility by returning only vectors <= 4
*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 plan.

I think I prefer Josh's patch.

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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]