diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-05 06:46:35 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-05 06:46:35 +0000 |
commit | 62380d2d2b9987a915182461cbaf4c984c8ed0bb (patch) | |
tree | ad0e21ca2e7c1cb2a9d00489abf7bf7d0bc9fb0e /gcc/stmt.c | |
parent | ece183a2fa210842cfdd885b258222b8962fa98b (diff) | |
download | ppe42-gcc-62380d2d2b9987a915182461cbaf4c984c8ed0bb.tar.gz ppe42-gcc-62380d2d2b9987a915182461cbaf4c984c8ed0bb.zip |
PR middle-end/11151
* function.h (struct function): New field 'x_naked_return_label'.
* function.c (free_after_compilation): Set it to NULL.
(expand_function_end): Emit 'naked_return_label' if it exists.
* rtl.h (expand_naked_return): Declare.
* stmt.c (expand_naked_return): New function to generate a
jump to 'naked_return_label'.
* builtins.c (expand_builtin_return): Call expand_naked_return
instead of expand_null_return.
* config/sparc/sparc.md (untyped_return): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74312 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index a7c910437f1..324789da312 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -2885,6 +2885,26 @@ expand_null_return (void) expand_null_return_1 (last_insn); } +/* Generate RTL to return directly from the current function. + (That is, we bypass any return value.) */ + +void +expand_naked_return (void) +{ + rtx last_insn, end_label; + + last_insn = get_last_insn (); + end_label = naked_return_label; + + clear_pending_stack_adjust (); + do_pending_stack_adjust (); + clear_last_expr (); + + if (end_label == 0) + end_label = naked_return_label = gen_label_rtx (); + expand_goto_internal (NULL_TREE, end_label, last_insn); +} + /* Try to guess whether the value of return means error code. */ static enum br_predictor return_prediction (rtx val) |