ARM patches applied
Richard Earnshaw
rearnsha@arm.com
Sun Feb 28 18:15:00 GMT 1999
> > See below (arm_return_in_memory). As a note here, I don't like the way
> > the netbsd port is doing that (it uses non-pcc struct returning to compile
> > just one file in the standard library which contains the soft-float code,
> > it then needs structures of 2 words to be returned in registers -- very
> > dodgy, it would be better to fix the source file in libc so the undef
> > wasn't needed).
> Haven't the netbsd folks gone back and forth a couple times on this issue; I
> seem to recall it being discussed before.
>
> The problem (as I see it) is if they change then they break backwards
> compatibility.
>
Yes, but in the end the issue really turned out to be that they use PCC
struct returning: for them all structs and unions return in memory.
However, they have one file in libc which needs to return a structure in
registers (so that they can soft-float emulate returning a double in
r0,r1). They currently hack this by compiling that file with
-freg-strcut-return (or whatever). With the new definition of
RETURN_IN_MEMORY this all breaks because the APCS mandates that structures
larger than a word must always be returned in memory. The correct fix,
long-term is to make the soft-float emulation code return a long long;
whereupon the #undef of RETURN_IN_MEMORY can be deleted.
Richard.
More information about the Gcc-patches
mailing list