From 8e235bee4a83fc630241dff7b9fda8f3abcf4ada Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sun, 16 Nov 2008 17:07:15 +0000 Subject: [PATCH] sparc.c (function_arg_vector_value): Remove 'base_mode' parameter. * config/sparc/sparc.c (function_arg_vector_value): Remove 'base_mode' parameter. Use DImode for computing the number of registers. (function_arg): Adjust for above change. (function_value): Likewise. From-SVN: r141923 --- gcc/ChangeLog | 7 +++++++ gcc/config/sparc/sparc.c | 15 +++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa409a39dbe2..2d2ed2733781 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-11-16 Eric Botcazou + + * config/sparc/sparc.c (function_arg_vector_value): Remove 'base_mode' + parameter. Use DImode for computing the number of registers. + (function_arg): Adjust for above change. + (function_value): Likewise. + 2008-11-13 Uros Bizjak Backport from mainline: diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 836096470cb8..583ef37b3a75 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -5026,15 +5026,13 @@ function_arg_union_value (int size, enum machine_mode mode, int slotno, Return an expression valid as a return value for the two macros FUNCTION_ARG and FUNCTION_VALUE. - SIZE is the size in bytes of the vector. - BASE_MODE is the argument's base machine mode. + SIZE is the size in bytes of the vector (at least 8 bytes). REGNO is the FP hard register the vector will be passed in. */ static rtx -function_arg_vector_value (int size, enum machine_mode base_mode, int regno) +function_arg_vector_value (int size, int regno) { - unsigned short base_mode_size = GET_MODE_SIZE (base_mode); - int nregs = size / base_mode_size, i; + int i, nregs = size / 8; rtx regs; regs = gen_rtx_PARALLEL (BLKmode, rtvec_alloc (nregs)); @@ -5043,9 +5041,8 @@ function_arg_vector_value (int size, enum machine_mode base_mode, int regno) { XVECEXP (regs, 0, i) = gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (base_mode, regno), - GEN_INT (base_mode_size * i)); - regno += base_mode_size / 4; + gen_rtx_REG (DImode, regno + 2*i), + GEN_INT (i*8)); } return regs; @@ -5091,7 +5088,6 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode, if (mode == BLKmode) return function_arg_vector_value (size, - TYPE_MODE (TREE_TYPE (type)), SPARC_FP_ARG_FIRST + 2*slotno); else mclass = MODE_FLOAT; @@ -5507,7 +5503,6 @@ function_value (tree type, enum machine_mode mode, int incoming_p) if (mode == BLKmode) return function_arg_vector_value (size, - TYPE_MODE (TREE_TYPE (type)), SPARC_FP_ARG_FIRST); else mclass = MODE_FLOAT; -- 2.47.2