From 69494148175d2ec7bc700b9939645a0df40b8cc1 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 29 Oct 2003 16:36:12 +0100 Subject: [PATCH] sparc.c (function_arg_partial_nregs): Never return 1 for complex integral modes whose size is lesser or equal to a word. * config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]: Never return 1 for complex integral modes whose size is lesser or equal to a word. (function_arg_pass_by_reference) [TARGET_ARCH64]: Mention CTImode in the comment. (function_arg_advance) [TARGET_ARCH64]: Don't special-case complex modes. (sparc_va_arg) [TARGET_ARCH64]: Handle any types whose is greater than 16 bytes by reference. From-SVN: r73044 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/sparc/sparc.c | 36 ++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1089cc74f58..a4a32b1325eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2003-10-29 Eric Botcazou + + * config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]: + Never return 1 for complex integral modes whose size is lesser or + equal to a word. + (function_arg_pass_by_reference) [TARGET_ARCH64]: Mention CTImode + in the comment. + (function_arg_advance) [TARGET_ARCH64]: Don't special-case complex + modes. + (sparc_va_arg) [TARGET_ARCH64]: Handle any types whose is greater + than 16 bytes by reference. + 2003-10-29 Richard Kenner * config/ia64/ia64.c (ia64_assemble_integer): Test POINTER_SIZE, diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 82244d8daba0..1e77430f1c7a 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -5429,7 +5429,8 @@ function_arg_partial_nregs (const struct sparc_args *cum, && slotno == SPARC_INT_ARG_MAX - 1) return 1; } - else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT + else if ((GET_MODE_CLASS (mode) == MODE_COMPLEX_INT + && GET_MODE_SIZE (mode) > UNITS_PER_WORD) || (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT && ! (TARGET_FPU && named))) { @@ -5476,7 +5477,8 @@ function_arg_pass_by_reference (const struct sparc_args *cum ATTRIBUTE_UNUSED, else { return ((type && TREE_CODE (type) == ARRAY_TYPE) - /* Consider complex values as aggregates, so care for TCmode. */ + /* Consider complex values as aggregates, so care + for CTImode and TCmode. */ || GET_MODE_SIZE (mode) > 16 || (type && AGGREGATE_TYPE_P (type) @@ -5521,14 +5523,6 @@ function_arg_advance (struct sparc_args *cum, enum machine_mode mode, else /* passed by reference */ ++cum->words; } - else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT) - { - cum->words += 2; - } - else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT) - { - cum->words += GET_MODE_SIZE (mode) / UNITS_PER_WORD; - } else { cum->words += (mode != BLKmode @@ -5661,17 +5655,19 @@ sparc_va_arg (tree valist, tree type) if (TYPE_ALIGN (type) >= 2 * (unsigned) BITS_PER_WORD) align = 2 * UNITS_PER_WORD; - if (AGGREGATE_TYPE_P (type)) + /* Consider complex values as aggregates, so care + for CTImode and TCmode. */ + if ((unsigned HOST_WIDE_INT) size > 16) { - if ((unsigned HOST_WIDE_INT) size > 16) - { - indirect = 1; - size = rsize = UNITS_PER_WORD; - align = 0; - } - /* SPARC v9 ABI states that structures up to 8 bytes in size are - given one 8 byte slot. */ - else if (size == 0) + indirect = 1; + size = rsize = UNITS_PER_WORD; + align = 0; + } + else if (AGGREGATE_TYPE_P (type)) + { + /* SPARC-V9 ABI states that structures up to 16 bytes in size + are given whole slots as needed. */ + if (size == 0) size = rsize = UNITS_PER_WORD; else size = rsize;