aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>1999-11-04 16:35:10 -0800
committerRichard Henderson <rth@gcc.gnu.org>1999-11-04 16:35:10 -0800
commitbd695e1e9d018a98de8d09bd855574dc6e183ad9 (patch)
tree3bf8e0ad4395b139c88e9c1ff7b7933ea4b1d9db /gcc/stmt.c
parent49886fe1cef61d4d3957033290d324dd27f7d389 (diff)
downloadgcc-bd695e1e9d018a98de8d09bd855574dc6e183ad9.zip
gcc-bd695e1e9d018a98de8d09bd855574dc6e183ad9.tar.gz
gcc-bd695e1e9d018a98de8d09bd855574dc6e183ad9.tar.bz2
function.c (diddle_return_value): New.
* function.c (diddle_return_value): New. (expand_function_end): Use it. * stmt.c (expand_null_return): Likewise. (expand_value_return): Likewise. * reg-stack.c (subst_stack_regs_pat): Handle clobbers at top-level. * reload1.c (reload): Don't remove return value clobbers. From-SVN: r30401
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 715f6e0..f38b94f 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2665,7 +2665,13 @@ void
expand_null_return ()
{
struct nesting *block = block_stack;
- rtx last_insn = 0;
+ rtx last_insn = get_last_insn ();
+
+ /* If this function was declared to return a value, but we
+ didn't, clobber the return registers so that they are not
+ propogated live to the rest of the function. */
+
+ diddle_return_value (CLOBBER);
/* Does any pending block have cleanups? */
@@ -2710,25 +2716,7 @@ expand_value_return (val)
emit_move_insn (return_reg, val);
}
- if (GET_CODE (return_reg) == REG
- && REGNO (return_reg) < FIRST_PSEUDO_REGISTER)
- emit_insn (gen_rtx_USE (VOIDmode, return_reg));
-
- /* Handle calls that return values in multiple non-contiguous locations.
- The Irix 6 ABI has examples of this. */
- else if (GET_CODE (return_reg) == PARALLEL)
- {
- int i;
-
- for (i = 0; i < XVECLEN (return_reg, 0); i++)
- {
- rtx x = XEXP (XVECEXP (return_reg, 0, i), 0);
-
- if (GET_CODE (x) == REG
- && REGNO (x) < FIRST_PSEUDO_REGISTER)
- emit_insn (gen_rtx_USE (VOIDmode, x));
- }
- }
+ diddle_return_value (USE);
/* Does any pending block have cleanups? */