diff options
| author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-06 17:39:56 +0000 |
|---|---|---|
| committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-06 17:39:56 +0000 |
| commit | f27b5d768f86c3664b62cc2d11bab1f42c37d104 (patch) | |
| tree | 99b39b57afa574f87067235b2cd7787c9eaa4071 | |
| parent | 720c006a110260eee5f1157d42293d6cd7c7fd53 (diff) | |
| download | ppe42-gcc-f27b5d768f86c3664b62cc2d11bab1f42c37d104.tar.gz ppe42-gcc-f27b5d768f86c3664b62cc2d11bab1f42c37d104.zip | |
* config/sparc/sparc.c (function_arg_record_value_1): Skip
fields with zero length.
(function_arg_record_value_2): Likewise.
(function_arg_record_value_3): Use smallest_mode_for_size
instead of mode_for_size.
(function_arg_union_value): Return naked register for unions
with zero length.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90180 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 10 | ||||
| -rw-r--r-- | gcc/config/sparc/sparc.c | 30 |
2 files changed, 32 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 138c1406c60..1c0215796d3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,15 @@ 2004-11-06 Eric Botcazou <ebotcazou@libertysurf.fr> + * config/sparc/sparc.c (function_arg_record_value_1): Skip + fields with zero length. + (function_arg_record_value_2): Likewise. + (function_arg_record_value_3): Use smallest_mode_for_size + instead of mode_for_size. + (function_arg_union_value): Return naked register for unions + with zero length. + +2004-11-06 Eric Botcazou <ebotcazou@libertysurf.fr> + * config/sparc/sparc.c (scan_record_type): Handle vector types. (function_arg_slotno): Handle vector types specially. (function_arg_record_value_1): Split fields with vector type and diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index d44ab95877c..5c5b3267b4e 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -5262,9 +5262,14 @@ function_arg_record_value_1 (tree type, HOST_WIDE_INT startbitpos, { HOST_WIDE_INT bitpos = startbitpos; - if (DECL_SIZE (field) != 0 - && host_integerp (bit_position (field), 1)) - bitpos += int_bit_position (field); + if (DECL_SIZE (field) != 0) + { + if (integer_zerop (DECL_SIZE (field))) + continue; + + if (host_integerp (bit_position (field), 1)) + bitpos += int_bit_position (field); + } /* ??? FIXME: else assume zero offset. */ @@ -5355,8 +5360,8 @@ function_arg_record_value_3 (HOST_WIDE_INT bitpos, at the moment but may wish to revisit. */ if (intoffset % BITS_PER_WORD != 0) - mode = mode_for_size (BITS_PER_WORD - intoffset % BITS_PER_WORD, - MODE_INT, 0); + mode = smallest_mode_for_size (BITS_PER_WORD - intoffset % BITS_PER_WORD, + MODE_INT); else mode = word_mode; @@ -5405,9 +5410,14 @@ function_arg_record_value_2 (tree type, HOST_WIDE_INT startbitpos, { HOST_WIDE_INT bitpos = startbitpos; - if (DECL_SIZE (field) != 0 - && host_integerp (bit_position (field), 1)) - bitpos += int_bit_position (field); + if (DECL_SIZE (field) != 0) + { + if (integer_zerop (DECL_SIZE (field))) + continue; + + if (host_integerp (bit_position (field), 1)) + bitpos += int_bit_position (field); + } /* ??? FIXME: else assume zero offset. */ @@ -5588,6 +5598,10 @@ function_arg_union_value (int size, enum machine_mode mode, int regno) int nwords = ROUND_ADVANCE (size), i; rtx regs; + /* See comment in previous function for empty structures. */ + if (nwords == 0) + return gen_rtx_REG (mode, regno); + regs = gen_rtx_PARALLEL (mode, rtvec_alloc (nwords)); for (i = 0; i < nwords; i++) |

