[PATCH] Fix PR target/10142 (SPARC64)
Eric Botcazou
ebotcazou@libertysurf.fr
Wed Jun 11 13:02:00 GMT 2003
Hi,
GCC currently (all 3.x releases I tested) doesn't correctly pass by value
structures whose size is 8 < s <=16 on SPARC64. The 64-bit ABI requires such
structures to be passed in registers if possible, (partially) on the stack
otherwise. It turns out that, if a structure contains an "integer" field and
the six integer slots have already been filled, the "integer" field is
simply not passed at all.
Bootstrapped/regtested (c,c++,objc,f77 mainine) on sparc64-sun-solaris2.9.
No testcase because the patch fixes
FAIL: gcc.dg/compat/struct-by-value-2 c_compat_x_tst.o-c_compat_y_tst.o
execute
FAIL: gcc.dg/compat/struct-by-value-4 c_compat_x_tst.o-c_compat_y_tst.o
execute
FAIL: gcc.dg/compat/struct-by-value-8 c_compat_x_tst.o-c_compat_y_tst.o
execute
against self as well as against the Sun Forte C compiler on mainline.
Ok for mainline? What about the 3.3 branch?
--
Eric Botcazou
2003-06-11 Eric Botcazou <ebotcazou@libertysurf.fr>
Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
PR target/10142
* config/sparc/sparc.c (function_arg_record_value_parms): Add
new 'stack' field.
(function_arg_record_value_1): Set 'stack' to 1 if we run out of
integer slots for an integer field.
(function_arg_record_value_3): Shift vector index.
(function_arg_record_value_2): Likewise.
(function_arg_record_value): Initialize 'stack' to 0.
Set 'stack' to 1 if we run out of integer slots for an integer field.
Generate (parallel [(expr_list (nil) ...) ...]) if 'stack' is set to 1.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr10142-2.diff
Type: text/x-diff
Size: 5051 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030611/e2f1b351/attachment.bin>
More information about the Gcc-patches
mailing list