From db3c03158c04178b274114428458ee758284c93c Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 18 May 2001 07:25:50 +0000 Subject: function.c (expand_function_start): Avoid creating BLKmode pseudos. * function.c (expand_function_start): Avoid creating BLKmode pseudos. * dwarf2out.c (output_comp_unit): Always output a compilation-unit DIE, even if it has no children. (dwarf2out_finish): Always output the line-number table, even if it has no content. From-SVN: r42254 --- gcc/function.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'gcc/function.c') diff --git a/gcc/function.c b/gcc/function.c index 3721a60..54dd308 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6370,21 +6370,25 @@ expand_function_start (subr, parms_have_cleanups) || current_function_instrument_entry_exit || (flag_exceptions && USING_SJLJ_EXCEPTIONS)) { - /* If function will end with cleanup code for parms, - compute the return values into a pseudo reg, - which we will copy into the true return register - after the cleanups are done. */ - - enum machine_mode mode = DECL_MODE (DECL_RESULT (subr)); - -#ifdef PROMOTE_FUNCTION_RETURN - tree type = TREE_TYPE (DECL_RESULT (subr)); - int unsignedp = TREE_UNSIGNED (type); - - mode = promote_mode (type, mode, &unsignedp, 1); -#endif + /* If function will end with cleanup code for parms, compute the + return values into a pseudo reg, which we will copy into the + true return register after the cleanups are done. */ + + /* In order to figure out what mode to use for the pseudo, we + figure out what the mode of the eventual return register will + actually be, and use that. */ + rtx hard_reg + = hard_function_value (TREE_TYPE (DECL_RESULT (subr)), + subr, 1); + + /* Since we know the return value is not an aggregate, we should + have a REG here. */ + if (!REG_P (hard_reg)) + abort (); - SET_DECL_RTL (DECL_RESULT (subr), gen_reg_rtx (mode)); + /* Create the pseudo. */ + SET_DECL_RTL (DECL_RESULT (subr), + gen_reg_rtx (GET_MODE (hard_reg))); /* Needed because we may need to move this to memory in case it's a named return value whose address is taken. */ DECL_REGISTER (DECL_RESULT (subr)) = 1; -- cgit v1.1