[PATCH] Fix PR target/13559

Eric Botcazou ebotcazou@libertysurf.fr
Wed Jan 21 10:15:00 GMT 2004


Hi,

This is another deviation from the psABI on SPARC64.  The compiler doesn't 
correctly handle the following structure:

struct sfi {
  float f;
  int i;
  int j;
};

'j' is passed in the right-half of %o1 while the ABI wants the left-half.


Fixed by reverting to 'word_mode' for the second slot of the parameters 
array, once 'i' has been loaded with SImode.  The patch was 
bootstrapped/regtested on sparc64-sun-solaris2.9 (except Ada and libgcj) and 
compat-regtested against the Sun ONE Studio 8 compiler, together with 
Olivier's patch.  It fixes the 2 attached compat testcases.

OK for the compat testcases?


2004-01-21  Eric Botcazou  <ebotcazou@libertysurf.fr>

        PR target/13559
        * config/sparc/sparc.c (function_arg_record_value_3): Revert
	to 'word_mode' once the first slot has been filled.


2004-01-21  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* gcc.dg/compat/mixed-struct-check.h, mixed-struct-defs.h,
	mixed-struct-init.h: Add 4 mixed structure types.
	struct-by-value-21_main.c, struct-by-value-21_x.c,
	struct-by-value-21_y.c, struct-return-21_main.c,
	struct-return-21_x.c, struct-return-21_y.c: New files.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr13559.diff
Type: text/x-diff
Size: 1243 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040121/87284133/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr13559_testsuite.diff
Type: text/x-diff
Size: 16128 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040121/87284133/attachment-0001.bin>


More information about the Gcc-patches mailing list