diff options
author | Steven Bosscher <stevenb.gcc@gmail.com> | 2006-03-20 21:22:55 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2006-03-20 21:22:55 +0000 |
commit | ede497cfbd518c7fafda85bc7b5e26899e5b0f14 (patch) | |
tree | cf6c3c48c169fb06b596b3ffc42eb5980f17563d /gcc | |
parent | e13f1c1432140a43edd23a50c3916fa41fadd610 (diff) | |
download | gcc-ede497cfbd518c7fafda85bc7b5e26899e5b0f14.zip gcc-ede497cfbd518c7fafda85bc7b5e26899e5b0f14.tar.gz gcc-ede497cfbd518c7fafda85bc7b5e26899e5b0f14.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 74 | ||||
-rw-r--r-- | gcc/final.c | 1 | ||||
-rw-r--r-- | gcc/function.c | 16 | ||||
-rw-r--r-- | gcc/function.h | 4 | ||||
-rw-r--r-- | gcc/passes.c | 1 | ||||
-rw-r--r-- | gcc/rtl.h | 1 | ||||
-rw-r--r-- | gcc/stmt.c | 12 | ||||
-rw-r--r-- | gcc/tree-pass.h | 1 |
9 files changed, 29 insertions, 99 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 157a550..613fb84 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +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> PR tree-opt/26629 diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 06721c6..eabf88f 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3677,80 +3677,6 @@ find_line_note (rtx 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 at a specified place within the doubly-linked list. diff --git a/gcc/final.c b/gcc/final.c index f233f12..4a5fd18 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1417,7 +1417,6 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file, function. */ if (write_symbols) { - remove_unnecessary_notes (); reemit_insn_block_notes (); number_blocks (current_function_decl); /* We never actually put out begin/end notes for the top-level diff --git a/gcc/function.c b/gcc/function.c index 988d613..2e9aec0 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -331,7 +331,7 @@ free_after_compilation (struct function *f) f->x_return_label = NULL; f->x_naked_return_label = 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_parm_birth_insn = NULL; f->original_arg_vector = NULL; @@ -4224,8 +4224,8 @@ expand_function_start (tree subr) as opposed to parm setup. */ emit_note (NOTE_INSN_FUNCTION_BEG); - if (!NOTE_P (get_last_insn ())) - emit_note (NOTE_INSN_DELETED); + gcc_assert (NOTE_P (get_last_insn ())); + parm_birth_insn = get_last_insn (); if (current_function_profile) @@ -4235,10 +4235,10 @@ expand_function_start (tree subr) #endif } - /* After the display initializations is where the tail-recursion label - should go, if we end up needing one. Ensure we have a NOTE here - since some things (like trampolines) get placed before this. */ - tail_recursion_reentry = emit_note (NOTE_INSN_DELETED); + /* After the display initializations is where the stack checking + probe should go. */ + if(flag_stack_check) + stack_check_probe_note = emit_note (NOTE_INSN_DELETED); /* Make sure there is a line number after the function entry setup code. */ force_next_line_note (); @@ -4364,7 +4364,7 @@ expand_function_end (void) GEN_INT (STACK_CHECK_MAX_FRAME_SIZE)); seq = get_insns (); end_sequence (); - emit_insn_before (seq, tail_recursion_reentry); + emit_insn_before (seq, stack_check_probe_note); break; } } diff --git a/gcc/function.h b/gcc/function.h index 1b2484e..4a60eb2 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -239,7 +239,7 @@ struct function GTY(()) rtx x_stack_slot_list; /* 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 referenced. There are two cases where this is done: if nonlocal gotos @@ -503,7 +503,7 @@ extern int trampolines_created; #define stack_slot_list (cfun->x_stack_slot_list) #define parm_birth_insn (cfun->x_parm_birth_insn) #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 used_temp_slots (cfun->x_used_temp_slots) #define avail_temp_slots (cfun->x_avail_temp_slots) diff --git a/gcc/passes.c b/gcc/passes.c index 85bfefa..4dd4ac8 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -622,7 +622,6 @@ init_optimization_passes (void) *p = NULL; p = &pass_rest_of_compilation.sub; - NEXT_PASS (pass_remove_unnecessary_notes); NEXT_PASS (pass_init_function); NEXT_PASS (pass_jump); NEXT_PASS (pass_insn_locators_initialize); @@ -2065,7 +2065,6 @@ extern void remove_insn (rtx); extern void emit_insn_after_with_line_notes (rtx, rtx, rtx); extern rtx emit (rtx); extern void renumber_insns (void); -extern unsigned int remove_unnecessary_notes (void); extern rtx delete_insn (rtx); extern rtx entry_of_function (void); extern void delete_insn_chain (rtx, rtx); @@ -2364,19 +2364,9 @@ expand_case (tree exp) } - /* Make sure start points to something that won't need any - transformation before the end of this function. */ - start = get_last_insn (); - if (! NOTE_P (start)) - { - emit_note (NOTE_INSN_DELETED); - start = get_last_insn (); - } - + before_case = start = get_last_insn (); default_label = label_rtx (default_label_decl); - before_case = get_last_insn (); - /* Get upper and lower bounds of case values. */ uniq = 0; diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 7f05d3c..5e0b923 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -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_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_jump; extern struct tree_opt_pass pass_insn_locators_initialize; |