On 02/05/2015 05:18 PM, Alan Modra wrote:
On Thu, Feb 05, 2015 at 08:59:01PM +1030, Alan Modra wrote:
Thanks, I'll use it directly now and have a patch in the works to tidy
m32c.c and rs6000.c.
As threatened, the emit-rtl tidy. Besides adding a couple of
accessors, I've moved x_first_insn and x_last_insn into a struct
sequence_stack. This seemed natural to me, making
get_topmost_sequence possible, and simplifying functions in emit-rtl.c
that need to operate on both the current sequence and any pushed
sequences.
If you look carefully, you'll see I delete some lines in remove_insn:
- if (next)
- SET_PREV_INSN (next) = NULL;
that don't seem to be covered by the loop. That's a deliberate
change. Jan added those lines in rev 160111 and 160121 for apparently
no good reason. See SET_PREV_INSN (next) = prev; a little later in
the function.
Bootstrapped and regression tested powerpc64-linux and x86_64-linux.
I've built an m32c compiler but haven't yet bootstapped it - I'm a
little rusty on setting up a sim environment.
OK when stage1 opens?
* 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.
OK with a fresh bootstrap on ppc or x86_64.
jeff