Commit ede497cf by Steven Bosscher Committed by Steven Bosscher

function.h (struct function): Rename to x_stack_check_probe_note.

	* function.h (struct function) <x_tail_recursion_reentry>:
	Rename to x_stack_check_probe_note.
	(tail_recursion_reentry): Rename to stack_check_probe_note.
	* function.c: Replace tail_recursion_reentry with
	stack_check_probe_note everywhere.
	(expand_function_start): Only emit a note for
	stack_check_probe_note with -fstack-protect.
	* stmt.c (expand_case): Don't emit NOTE_INSN_DELETED notes.

	* emit-rtl.c (remove_unnecessary_notes): Remove.
	(pass_remove_unnecessary_notes): Remove.
	* rtl.h (remove_unnecessary_notes): Remove prototype.
	* final.c (final_start_function): Don't call remove_unnecessary_notes.
	* tree-pass.h (pass_remove_unnecessary_notes): Remove.
	* passes.c (pass_remove_unnecessary_notes): Don't run it.

From-SVN: r112229
parent e13f1c14
2006-03-20 Steven Bosscher <stevenb.gcc@gmail.com>
* function.h (struct function) <x_tail_recursion_reentry>:
Rename to x_stack_check_probe_note.
(tail_recursion_reentry): Rename to stack_check_probe_note.
* function.c: Replace tail_recursion_reentry with
stack_check_probe_note everywhere.
(expand_function_start): Only emit a note for
stack_check_probe_note with -fstack-protect.
* stmt.c (expand_case): Don't emit NOTE_INSN_DELETED notes.
* emit-rtl.c (remove_unnecessary_notes): Remove.
(pass_remove_unnecessary_notes): Remove.
* rtl.h (remove_unnecessary_notes): Remove prototype.
* final.c (final_start_function): Don't call remove_unnecessary_notes.
* tree-pass.h (pass_remove_unnecessary_notes): Remove.
* passes.c (pass_remove_unnecessary_notes): Don't run it.
2006-03-20 Andrew Pinski <pinskia@physics.uc.edu> 2006-03-20 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/26629 PR tree-opt/26629
......
...@@ -3677,80 +3677,6 @@ find_line_note (rtx insn) ...@@ -3677,80 +3677,6 @@ find_line_note (rtx insn)
return insn; return insn;
} }
/* Remove unnecessary notes from the instruction stream. */
unsigned int
remove_unnecessary_notes (void)
{
rtx eh_stack = NULL_RTX;
rtx insn;
rtx next;
rtx tmp;
/* We must not remove the first instruction in the function because
the compiler depends on the first instruction being a note. */
for (insn = NEXT_INSN (get_insns ()); insn; insn = next)
{
/* Remember what's next. */
next = NEXT_INSN (insn);
/* We're only interested in notes. */
if (!NOTE_P (insn))
continue;
switch (NOTE_LINE_NUMBER (insn))
{
case NOTE_INSN_DELETED:
remove_insn (insn);
break;
case NOTE_INSN_EH_REGION_BEG:
eh_stack = alloc_INSN_LIST (insn, eh_stack);
break;
case NOTE_INSN_EH_REGION_END:
/* Too many end notes. */
gcc_assert (eh_stack);
/* Mismatched nesting. */
gcc_assert (NOTE_EH_HANDLER (XEXP (eh_stack, 0))
== NOTE_EH_HANDLER (insn));
tmp = eh_stack;
eh_stack = XEXP (eh_stack, 1);
free_INSN_LIST_node (tmp);
break;
case NOTE_INSN_BLOCK_BEG:
case NOTE_INSN_BLOCK_END:
/* BLOCK_END and BLOCK_BEG notes only exist in the `final' pass. */
gcc_unreachable ();
default:
break;
}
}
/* Too many EH_REGION_BEG notes. */
gcc_assert (!eh_stack);
return 0;
}
struct tree_opt_pass pass_remove_unnecessary_notes =
{
"eunotes", /* name */
NULL, /* gate */
remove_unnecessary_notes, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
0, /* tv_id */
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_dump_func, /* todo_flags_finish */
0 /* letter */
};
/* Emit insn(s) of given code and pattern /* Emit insn(s) of given code and pattern
at a specified place within the doubly-linked list. at a specified place within the doubly-linked list.
......
...@@ -1417,7 +1417,6 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file, ...@@ -1417,7 +1417,6 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
function. */ function. */
if (write_symbols) if (write_symbols)
{ {
remove_unnecessary_notes ();
reemit_insn_block_notes (); reemit_insn_block_notes ();
number_blocks (current_function_decl); number_blocks (current_function_decl);
/* We never actually put out begin/end notes for the top-level /* We never actually put out begin/end notes for the top-level
......
...@@ -331,7 +331,7 @@ free_after_compilation (struct function *f) ...@@ -331,7 +331,7 @@ free_after_compilation (struct function *f)
f->x_return_label = NULL; f->x_return_label = NULL;
f->x_naked_return_label = NULL; f->x_naked_return_label = NULL;
f->x_stack_slot_list = NULL; f->x_stack_slot_list = NULL;
f->x_tail_recursion_reentry = NULL; f->x_stack_check_probe_note = NULL;
f->x_arg_pointer_save_area = NULL; f->x_arg_pointer_save_area = NULL;
f->x_parm_birth_insn = NULL; f->x_parm_birth_insn = NULL;
f->original_arg_vector = NULL; f->original_arg_vector = NULL;
...@@ -4224,8 +4224,8 @@ expand_function_start (tree subr) ...@@ -4224,8 +4224,8 @@ expand_function_start (tree subr)
as opposed to parm setup. */ as opposed to parm setup. */
emit_note (NOTE_INSN_FUNCTION_BEG); emit_note (NOTE_INSN_FUNCTION_BEG);
if (!NOTE_P (get_last_insn ())) gcc_assert (NOTE_P (get_last_insn ()));
emit_note (NOTE_INSN_DELETED);
parm_birth_insn = get_last_insn (); parm_birth_insn = get_last_insn ();
if (current_function_profile) if (current_function_profile)
...@@ -4235,10 +4235,10 @@ expand_function_start (tree subr) ...@@ -4235,10 +4235,10 @@ expand_function_start (tree subr)
#endif #endif
} }
/* After the display initializations is where the tail-recursion label /* After the display initializations is where the stack checking
should go, if we end up needing one. Ensure we have a NOTE here probe should go. */
since some things (like trampolines) get placed before this. */ if(flag_stack_check)
tail_recursion_reentry = emit_note (NOTE_INSN_DELETED); stack_check_probe_note = emit_note (NOTE_INSN_DELETED);
/* Make sure there is a line number after the function entry setup code. */ /* Make sure there is a line number after the function entry setup code. */
force_next_line_note (); force_next_line_note ();
...@@ -4364,7 +4364,7 @@ expand_function_end (void) ...@@ -4364,7 +4364,7 @@ expand_function_end (void)
GEN_INT (STACK_CHECK_MAX_FRAME_SIZE)); GEN_INT (STACK_CHECK_MAX_FRAME_SIZE));
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
emit_insn_before (seq, tail_recursion_reentry); emit_insn_before (seq, stack_check_probe_note);
break; break;
} }
} }
......
...@@ -239,7 +239,7 @@ struct function GTY(()) ...@@ -239,7 +239,7 @@ struct function GTY(())
rtx x_stack_slot_list; rtx x_stack_slot_list;
/* Place after which to insert the tail_recursion_label if we need one. */ /* Place after which to insert the tail_recursion_label if we need one. */
rtx x_tail_recursion_reentry; rtx x_stack_check_probe_note;
/* Location at which to save the argument pointer if it will need to be /* Location at which to save the argument pointer if it will need to be
referenced. There are two cases where this is done: if nonlocal gotos referenced. There are two cases where this is done: if nonlocal gotos
...@@ -503,7 +503,7 @@ extern int trampolines_created; ...@@ -503,7 +503,7 @@ extern int trampolines_created;
#define stack_slot_list (cfun->x_stack_slot_list) #define stack_slot_list (cfun->x_stack_slot_list)
#define parm_birth_insn (cfun->x_parm_birth_insn) #define parm_birth_insn (cfun->x_parm_birth_insn)
#define frame_offset (cfun->x_frame_offset) #define frame_offset (cfun->x_frame_offset)
#define tail_recursion_reentry (cfun->x_tail_recursion_reentry) #define stack_check_probe_note (cfun->x_stack_check_probe_note)
#define arg_pointer_save_area (cfun->x_arg_pointer_save_area) #define arg_pointer_save_area (cfun->x_arg_pointer_save_area)
#define used_temp_slots (cfun->x_used_temp_slots) #define used_temp_slots (cfun->x_used_temp_slots)
#define avail_temp_slots (cfun->x_avail_temp_slots) #define avail_temp_slots (cfun->x_avail_temp_slots)
......
...@@ -622,7 +622,6 @@ init_optimization_passes (void) ...@@ -622,7 +622,6 @@ init_optimization_passes (void)
*p = NULL; *p = NULL;
p = &pass_rest_of_compilation.sub; p = &pass_rest_of_compilation.sub;
NEXT_PASS (pass_remove_unnecessary_notes);
NEXT_PASS (pass_init_function); NEXT_PASS (pass_init_function);
NEXT_PASS (pass_jump); NEXT_PASS (pass_jump);
NEXT_PASS (pass_insn_locators_initialize); NEXT_PASS (pass_insn_locators_initialize);
......
...@@ -2065,7 +2065,6 @@ extern void remove_insn (rtx); ...@@ -2065,7 +2065,6 @@ extern void remove_insn (rtx);
extern void emit_insn_after_with_line_notes (rtx, rtx, rtx); extern void emit_insn_after_with_line_notes (rtx, rtx, rtx);
extern rtx emit (rtx); extern rtx emit (rtx);
extern void renumber_insns (void); extern void renumber_insns (void);
extern unsigned int remove_unnecessary_notes (void);
extern rtx delete_insn (rtx); extern rtx delete_insn (rtx);
extern rtx entry_of_function (void); extern rtx entry_of_function (void);
extern void delete_insn_chain (rtx, rtx); extern void delete_insn_chain (rtx, rtx);
......
...@@ -2364,19 +2364,9 @@ expand_case (tree exp) ...@@ -2364,19 +2364,9 @@ expand_case (tree exp)
} }
/* Make sure start points to something that won't need any before_case = start = get_last_insn ();
transformation before the end of this function. */
start = get_last_insn ();
if (! NOTE_P (start))
{
emit_note (NOTE_INSN_DELETED);
start = get_last_insn ();
}
default_label = label_rtx (default_label_decl); default_label = label_rtx (default_label_decl);
before_case = get_last_insn ();
/* Get upper and lower bounds of case values. */ /* Get upper and lower bounds of case values. */
uniq = 0; uniq = 0;
......
...@@ -322,7 +322,6 @@ extern struct tree_opt_pass pass_free_datastructures; ...@@ -322,7 +322,6 @@ extern struct tree_opt_pass pass_free_datastructures;
extern struct tree_opt_pass pass_init_datastructures; extern struct tree_opt_pass pass_init_datastructures;
extern struct tree_opt_pass pass_fixup_cfg; extern struct tree_opt_pass pass_fixup_cfg;
extern struct tree_opt_pass pass_remove_unnecessary_notes;
extern struct tree_opt_pass pass_init_function; extern struct tree_opt_pass pass_init_function;
extern struct tree_opt_pass pass_jump; extern struct tree_opt_pass pass_jump;
extern struct tree_opt_pass pass_insn_locators_initialize; extern struct tree_opt_pass pass_insn_locators_initialize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment