aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-05-18 07:25:50 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-05-18 07:25:50 +0000
commitdb3c03158c04178b274114428458ee758284c93c (patch)
tree42a17eef2f12f7a1de6ec4d4deee148f64370649 /gcc/function.c
parent52a57250621b05048f505946c662675d083d8335 (diff)
downloadgcc-db3c03158c04178b274114428458ee758284c93c.zip
gcc-db3c03158c04178b274114428458ee758284c93c.tar.gz
gcc-db3c03158c04178b274114428458ee758284c93c.tar.bz2
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
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c32
1 files changed, 18 insertions, 14 deletions
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;