functions.
* rtl.h (get_first_nonnote_insn, get_last_nonnote_insn): Declare.
* avr/avr.c (avr_output_function_epilogue): Use above to determine
function size.
* pa/pa.c (pa_output_function_prologue): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54304
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-06-06 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): New
+ functions.
+ * rtl.h (get_first_nonnote_insn, get_last_nonnote_insn): Declare.
+ * avr/avr.c (avr_output_function_epilogue): Use above to determine
+ function size.
+ * pa/pa.c (pa_output_function_prologue): Likewise.
+
2002-06-05 David S. Miller <davem@redhat.com>
* integrate.c (subst_constants): Handle 'B' RTL format.
interrupt_func_p = interrupt_function_p (current_function_decl);
signal_func_p = signal_function_p (current_function_decl);
main_p = MAIN_NAME_P (DECL_NAME (current_function_decl));
- function_size = (INSN_ADDRESSES (INSN_UID (get_last_insn ()))
- - INSN_ADDRESSES (INSN_UID (get_insns ())));
+ function_size = (INSN_ADDRESSES (INSN_UID (get_last_nonnote_insn ()))
+ - INSN_ADDRESSES (INSN_UID (get_first_nonnote_insn ())));
function_size += jump_tables_size;
live_seq = sequent_regs_live ();
minimize = (TARGET_CALL_PROLOGUES
{
unsigned int old_total = total_code_bytes;
- total_code_bytes += INSN_ADDRESSES (INSN_UID (get_last_insn ()));
+ total_code_bytes += INSN_ADDRESSES (INSN_UID (get_last_nonnote_insn ()));
total_code_bytes += FUNCTION_BOUNDARY / BITS_PER_UNIT;
/* Be prepared to handle overflows. */
return 0;
}
+/* Return the first nonnote insn emitted in current sequence or current
+ function. This routine looks inside SEQUENCEs. */
+
+rtx
+get_first_nonnote_insn ()
+{
+ rtx insn = first_insn;
+
+ while (insn)
+ {
+ insn = next_insn (insn);
+ if (insn == 0 || GET_CODE (insn) != NOTE)
+ break;
+ }
+
+ return insn;
+}
+
+/* Return the last nonnote insn emitted in current sequence or current
+ function. This routine looks inside SEQUENCEs. */
+
+rtx
+get_last_nonnote_insn ()
+{
+ rtx insn = last_insn;
+
+ while (insn)
+ {
+ insn = previous_insn (insn);
+ if (insn == 0 || GET_CODE (insn) != NOTE)
+ break;
+ }
+
+ return insn;
+}
+
/* Return a number larger than any instruction's uid in this function. */
int
extern const char *get_insn_name PARAMS ((int));
extern rtx get_last_insn PARAMS ((void));
extern rtx get_last_insn_anywhere PARAMS ((void));
+extern rtx get_first_nonnote_insn PARAMS ((void));
+extern rtx get_last_nonnote_insn PARAMS ((void));
extern void start_sequence PARAMS ((void));
extern void push_to_sequence PARAMS ((rtx));
extern void end_sequence PARAMS ((void));