[PATCH] SPARC psABI fix, callee returns struct checking.

Mark Mitchell mark@codesourcery.com
Thu Mar 9 06:52:00 GMT 2006


Eric Botcazou wrote:

> I'd also veto Carlos' patch on that ground.  And this has nothing to do with 
> GCC-only systems, GCC works fine as-is on Solaris in practice.

Actually, not quite; this fix is for a bug report we received directly
from Sun, mixing code between the Sun compiler and the GCC compiler.
The bug report is the example Carlos gave in his patch.

>>  (David, the issue is not just academic; Sun's compiler omits the return
>> address when the value is cast to avoid, as in Carlos' example.)
> 
> What problem are you trying to solve?  Can't we be more clever?  Do you really 
> want to pessimize every single call returning a struct for the sake of 
> pathological cases?

We don't see any choice.  Obviously, we can have a switch, but in the
fully conforming mode, this is how the ABI works, according to Sun's ABI
experts, and they ought to know.  We can say that on non-Solaris systems
the ABI requires that callers pass the return address, but on Solaris,
Sun's compiler doesn't always do that, so it seems we must check.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list