diff options
author | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-15 06:05:44 +0000 |
---|---|---|
committer | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-15 06:05:44 +0000 |
commit | c36aa54b39d1e97ac912dcbef8550750bb2dc760 (patch) | |
tree | ef0b3b5fe19860d399f60a0610fc54c9edee6d90 /gcc/config/m32c/m32c.c | |
parent | 7502b19d938bde2fcfc9d5976e82003349dce04f (diff) | |
download | gcc-c36aa54b39d1e97ac912dcbef8550750bb2dc760.tar.gz |
* function.h (struct emit_status): Delete x_first_insn, x_last_insn
and sequence_stack. Add seq.
(seq_stack): Delete.
* function.c (prepare_function_start): Don't access x_last_insn.
* emit-rtl.h (get_current_sequence, get_topmost_sequence): New.
(get_insns, set_first_insn, get_last_insn, set_last_insn): Use them.
* emit_rtl.c (start_sequence, push_topmost_sequence,
pop_topmost_sequence, end_sequence, in_sequence_p, init_emit): Use
sequence accessors.
(get_last_insn_anywhere, add_insn_after_nobb, add_insn_before_nobb,
remove_insn): Likewise. Simplify.
* config/m32c/m32c.c (m32c_leaf_function_p): Use push_topmost_sequence
and pop_topmost_sequence.
(m32c_function_needs_enter): Use get_topmost_sequence. Ignore
debug insns.
* config/rs6000/rs6000.c (rs6000_call_aix): Use get_current_sequence.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222112 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/m32c/m32c.c')
-rw-r--r-- | gcc/config/m32c/m32c.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 5e295655598..f4c29f5de80 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -4056,24 +4056,11 @@ m32c_encode_section_info (tree decl, rtx rtl, int first) static int m32c_leaf_function_p (void) { - rtx_insn *saved_first, *saved_last; - struct sequence_stack *seq; int rv; - saved_first = crtl->emit.x_first_insn; - saved_last = crtl->emit.x_last_insn; - for (seq = crtl->emit.sequence_stack; seq && seq->next; seq = seq->next) - ; - if (seq) - { - crtl->emit.x_first_insn = seq->first; - crtl->emit.x_last_insn = seq->last; - } - + push_topmost_sequence (); rv = leaf_function_p (); - - crtl->emit.x_first_insn = saved_first; - crtl->emit.x_last_insn = saved_last; + pop_topmost_sequence (); return rv; } @@ -4084,23 +4071,17 @@ static bool m32c_function_needs_enter (void) { rtx_insn *insn; - struct sequence_stack *seq; rtx sp = gen_rtx_REG (Pmode, SP_REGNO); rtx fb = gen_rtx_REG (Pmode, FB_REGNO); - insn = get_insns (); - for (seq = crtl->emit.sequence_stack; - seq; - insn = seq->first, seq = seq->next); - - while (insn) - { - if (reg_mentioned_p (sp, insn)) - return true; - if (reg_mentioned_p (fb, insn)) - return true; - insn = NEXT_INSN (insn); - } + for (insn = get_topmost_sequence ()->first; insn; insn = NEXT_INSN (insn)) + if (NONDEBUG_INSN_P (insn)) + { + if (reg_mentioned_p (sp, insn)) + return true; + if (reg_mentioned_p (fb, insn)) + return true; + } return false; } |