diff options
author | Richard Stallman <rms@gnu.org> | 1993-06-19 22:32:28 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-06-19 22:32:28 +0000 |
commit | 9623736278220d48982d35fe8db9db926394030f (patch) | |
tree | 7e0e86f1aeea7671b832cee3d910c2c4ff11d341 /gcc | |
parent | af0da0b8cb21be42c90b14417a87af8d45b63582 (diff) | |
download | gcc-9623736278220d48982d35fe8db9db926394030f.zip gcc-9623736278220d48982d35fe8db9db926394030f.tar.gz gcc-9623736278220d48982d35fe8db9db926394030f.tar.bz2 |
(stack_result_p): New function.
(stack_reg_life_analysis): Use that.
From-SVN: r4699
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/reg-stack.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index c3d792e..33bd268 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -1217,6 +1217,30 @@ find_blocks (first) record_label_references (insn, PATTERN (insn)); } } + +/* If current function returns its result in an fp stack register, + return the register number. Otherwise return -1. */ + +static int +stack_result_p (decl) + tree decl; +{ + rtx result = DECL_RTL (DECL_RESULT (decl)); + + if (result != 0 + && !(GET_CODE (result) == REG + && REGNO (result) < FIRST_PSEUDO_REGISTER)) + { +#ifdef FUNCTION_OUTGOING_VALUE + result + = FUNCTION_OUTGOING_VALUE (TREE_TYPE (DECL_RESULT (decl)), decl); +#else + result = FUNCTION_VALUE (TREE_TYPE (DECL_RESULT (decl)), decl); +#endif + } + + return STACK_REG_P (result) ? REGNO (result) : -1; +} /* Determine the which registers are live at the start of each basic block of the function whose first insn is FIRST. @@ -1256,11 +1280,11 @@ stack_reg_life_analysis (first) struct stack_def regstack; if (current_function_returns_real - && STACK_REG_P (DECL_RTL (DECL_RESULT (current_function_decl)))) + && stack_result_p (current_function_decl) >= 0) { /* Find all RETURN insns and mark them. */ - int value_regno = REGNO (DECL_RTL (DECL_RESULT (current_function_decl))); + int value_regno = stack_result_p (current_function_decl); for (block = blocks - 1; block >= 0; block--) if (GET_CODE (block_end[block]) == JUMP_INSN |