From 640019aa4895ac391004e6531d4b6d984d7ed76d Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 12 Jan 2005 20:01:38 +0000 Subject: [PATCH] function.c (assign_parm_setup_block): Relax condition on multi-register optimization. * function.c (assign_parm_setup_block): Relax condition on multi-register optimization. From-SVN: r93233 --- gcc/ChangeLog | 5 +++++ gcc/function.c | 61 +++++++++++++++++++++++++++----------------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 63d96c1edc6..61d48463dad 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-01-12 Aldy Hernandez + + * function.c (assign_parm_setup_block): Relax condition on + multi-register optimization. + 2005-01-12 Nick Clifton * config/sh/sh.md (udivsi3_sh2a, divsi3_sh2a): Give these patterns diff --git a/gcc/function.c b/gcc/function.c index 250d71bcb12..4f1fc1a5e7e 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2560,42 +2560,47 @@ assign_parm_setup_block (struct assign_parm_data_all *all, /* If we've a non-block object that's nevertheless passed in parts, reconstitute it in register operations rather than on the stack. */ if (GET_CODE (entry_parm) == PARALLEL - && data->nominal_mode != BLKmode - && XVECLEN (entry_parm, 0) > 1 - && use_register_for_decl (parm)) + && data->nominal_mode != BLKmode) { - rtx parmreg = gen_reg_rtx (data->nominal_mode); + rtx elt0 = XEXP (XVECEXP (entry_parm, 0, 0), 0); - push_to_sequence (all->conversion_insns); + if ((XVECLEN (entry_parm, 0) > 1 + || hard_regno_nregs[REGNO (elt0)][GET_MODE (elt0)] > 1) + && use_register_for_decl (parm)) + { + rtx parmreg = gen_reg_rtx (data->nominal_mode); - /* For values returned in multiple registers, handle possible - incompatible calls to emit_group_store. + push_to_sequence (all->conversion_insns); - For example, the following would be invalid, and would have to - be fixed by the conditional below: + /* For values returned in multiple registers, handle possible + incompatible calls to emit_group_store. - emit_group_store ((reg:SF), (parallel:DF)) - emit_group_store ((reg:SI), (parallel:DI)) + For example, the following would be invalid, and would have to + be fixed by the conditional below: - An example of this are doubles in e500 v2: - (parallel:DF (expr_list (reg:SI) (const_int 0)) - (expr_list (reg:SI) (const_int 4))). */ - if (data->nominal_mode != data->passed_mode) - { - rtx t = gen_reg_rtx (GET_MODE (entry_parm)); - emit_group_store (t, entry_parm, NULL_TREE, - GET_MODE_SIZE (GET_MODE (entry_parm))); - convert_move (parmreg, t, 0); - } - else - emit_group_store (parmreg, entry_parm, data->nominal_type, - int_size_in_bytes (data->nominal_type)); + emit_group_store ((reg:SF), (parallel:DF)) + emit_group_store ((reg:SI), (parallel:DI)) - all->conversion_insns = get_insns (); - end_sequence (); + An example of this are doubles in e500 v2: + (parallel:DF (expr_list (reg:SI) (const_int 0)) + (expr_list (reg:SI) (const_int 4))). */ + if (data->nominal_mode != data->passed_mode) + { + rtx t = gen_reg_rtx (GET_MODE (entry_parm)); + emit_group_store (t, entry_parm, NULL_TREE, + GET_MODE_SIZE (GET_MODE (entry_parm))); + convert_move (parmreg, t, 0); + } + else + emit_group_store (parmreg, entry_parm, data->nominal_type, + int_size_in_bytes (data->nominal_type)); - SET_DECL_RTL (parm, parmreg); - return; + all->conversion_insns = get_insns (); + end_sequence (); + + SET_DECL_RTL (parm, parmreg); + return; + } } size = int_size_in_bytes (data->passed_type); -- 2.30.2