diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-05 00:35:10 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-05 00:35:10 +0000 |
commit | 631ef7ce153511a5edc1162394039f199393b55e (patch) | |
tree | 3bf8e0ad4395b139c88e9c1ff7b7933ea4b1d9db /gcc/stmt.c | |
parent | e1f2ec6ee8253c8f0c9160cee0abb7e9f95e681a (diff) | |
download | gcc-631ef7ce153511a5edc1162394039f199393b55e.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30401 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index 715f6e0cd69..f38b94fc942 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? */ |