diff options
author | Richard Henderson <rth@cygnus.com> | 2000-02-06 05:19:20 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-02-06 05:19:20 -0800 |
commit | 9a7372d64614a15d430fdf60a925a8958eec3ff3 (patch) | |
tree | 8df6ccbf96eb63f2169bbc0467efba575a5ec7a9 /gcc | |
parent | 69732dcb9c663d68d2a5d433ce76ed8da43e5632 (diff) | |
download | gcc-9a7372d64614a15d430fdf60a925a8958eec3ff3.zip gcc-9a7372d64614a15d430fdf60a925a8958eec3ff3.tar.gz gcc-9a7372d64614a15d430fdf60a925a8958eec3ff3.tar.bz2 |
i386.c (ix86_can_use_return_insn_p): Fail for large poped args and for non-empty stack frames.
* i386.c (ix86_can_use_return_insn_p): Fail for large poped args
and for non-empty stack frames.
* i386.md (return): Expand to return-pop as needed.
From-SVN: r31827
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 18 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 10 |
3 files changed, 29 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac0c643..06b32fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -11,6 +11,10 @@ * jump.c (jump_optimize_1): Remove code to insert a return insn on the fallthru to the exit block. + * i386.c (ix86_can_use_return_insn_p): Fail for large poped args + and for non-empty stack frames. + * i386.md (return): Expand to return-pop as needed. + 2000-02-06 Richard Henderson <rth@cygnus.com> * simplify-rtx.c (simplify_relational_operation): Canonicalize diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 82c0f07..de8517a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1555,15 +1555,29 @@ symbolic_reference_mentioned_p (op) int ix86_can_use_return_insn_p () { + HOST_WIDE_INT tsize; + int nregs; + #ifdef NON_SAVING_SETJMP if (NON_SAVING_SETJMP && current_function_calls_setjmp) return 0; #endif +#ifdef FUNCTION_BLOCK_PROFILER_EXIT + if (profile_block_flag == 2) + return 0; +#endif + + if (! reload_completed || frame_pointer_needed) + return 0; - if (! reload_completed) + /* Don't allow more than 32 pop, since that's all we can do + with one instruction. */ + if (current_function_pops_args + && current_function_args_size >= 32768) return 0; - return ix86_nsaved_regs () == 0 || ! frame_pointer_needed; + tsize = ix86_compute_frame_size (get_frame_size (), &nregs, NULL, NULL); + return tsize == 0 && nregs == 0; } static char *pic_label_name; diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 4c36024..7624f23 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -7218,7 +7218,15 @@ (define_expand "return" [(return)] "ix86_can_use_return_insn_p ()" - "") + " +{ + if (current_function_pops_args) + { + rtx popc = GEN_INT (current_function_pops_args); + emit_jump_insn (gen_return_pop_internal (popc)); + DONE; + } +}") (define_insn "return_internal" [(return)] |