aboutsummaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-09-21 14:55:18 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-09-21 12:55:18 +0000
commit53c170316f895dc3dfa7173e69fc43b15b7acb1a (patch)
tree270b09662a6e53b3a40319fd6d71ba88ad553f13 /gcc/jump.c
parentf2d3c02aa02309b6bd102066f4961451fbcfc1bb (diff)
downloadgcc-53c170316f895dc3dfa7173e69fc43b15b7acb1a.zip
gcc-53c170316f895dc3dfa7173e69fc43b15b7acb1a.tar.gz
gcc-53c170316f895dc3dfa7173e69fc43b15b7acb1a.tar.bz2
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill. * cfg.c (delete_insn): Rename from ....; use remove_insn; do not remove some labels. (flow_delete_insn): This one. (delete_insn_chain): Rename from ...; do not care labels. (flow_delete_insn_chain): ... this one. (flow_delete_block): Remove the insns one BB has been expunged. (merge_blocks_nomove): Likewise. (try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care updating BB boundaries. (tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. * cfgbuild.c (find_basic_block): Likewise. (find_basic_blocks_1): Likewise. * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise. (try_crossjump_to_edge): Likewise. (try_optimize_cfg): Likewise. * cse.c (delete_trivially_dead_insns): Likewise. * df.c (df_insn_delete): Likewise. * doloop.c (doloop_modify): Use delete_related_insns. * emit-rtl.c (try_split): Likewise. (remove_insn): Update BB boundaries. * expect.c (connect_post_landing_pads): Use delete_related_insns. * flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care updating BB boundaries. (propagate_block_delete_insn): Likewise. (propagate_block_delete_libcall): Likewise. * function.c (delete_handlers): Use delete_related_insns. (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (delete_null_pointer_checks): Use delete_related_insns. * genpeep.c (gen_peephole): Use delete_related_insns. * ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating BB boundaries. (find_cond_trap): Likewise. * integrate.c (save_for_inline): Use delete_related_insns. (copy_insn_list): Likewise. * jump.c (pruge_linie_number_notes): Likewise. (duplicate_loop_exit_test): Likewise. (delete_computation): Likewise. (delete_related_insn): Rename from ...; use delete_insn (delete_insn): ... this one. (redirect_jump): Use delete_related_insns. * loop.c (scan_loop): Likewise. (move_movables): Likewise. (find_and_verify_loops): Likewise. (check_dbra_loop): Likewise. * recog.c (peephole2_optimize): Likewise. * reg-stack.c (delete_insn_for_stacker): Remove. (move_for_stack_reg): Use delete_insn. * regmove.c (combine_stack_adjustments_for_block): Likewise. * reload1.c (delete_address_reloads): Use delete_related_insns. (fixup_abnormal_edges): Use delete_insn. * recog.c (emit_delay_sequence): Use delete_related_insns. (delete_from-delay_slot): Likewise. (delete_scheduled_jump): likewise. (optimize_skip): Likewise. (try_merge_delay_insns): Likewise. (full_simple_delay_slots): Likewise. (fill_slots_from_thread): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. * rtl.h (delete_insn): Rename to delete_related_insns. (delete_insn, delete_insn_chain): New prototypes. * ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done by df_insn_delete already. * ssa-dce.c (delete_insn_bb): Use delete_insn. * ssa.c (convert_from_ssa): Use delete_related_insns. * unroll.c (unroll_loop): Likewise. (calculate_giv_inc): Likewise. (copy_loop_body): Likewise. * i386-protos.h (ix86_libcall_value, ix86_function_value, ix86_function_arg_regno_p, ix86_function_arg_boundary, ix86_return_in_memory, ix86_function_value): Declare. * i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers): new static valurables. (x86_64_reg_class): New enum (x86_64_reg_class_name): New array. (classify_argument, examine_argument, construct_container, merge_classes): New static functions. (optimization_options): Enable flag_omit_frame_pointer and disable flag_pcc_struct_return on 64bit. (ix86_libcall_value, ix86_function_value, ix86_function_arg_regno_p, ix86_function_arg_boundary, ix86_return_in_memory, ix86_function_value): New global functions. (init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg. (function_arg_advance): Handle x86_64 passing conventions. (function_arg): Likewise. * i386.h (FUNCTION_ARG_BOUNDARY): New macro. (RETURN_IN_MEMORY): Move offline. (FUNCTION_VALUE, LIBCALL_VALUE): Likewise. (FUNCTION_VALUE_REGNO_P): New macro. (FUNCTION_ARG_REGNO_P): Move offline. (struct ix86_args): Add maybe_vaarg. * next.h (FUNCTION_VALUE_REGNO_P): Delete. * unix.h (FUNCTION_VALUE_REGNO_P): Delete. From-SVN: r45726
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c91
1 files changed, 23 insertions, 68 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index e8a8594..544b672 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -182,7 +182,7 @@ purge_line_number_notes (f)
&& NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last_note)
&& NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note))
{
- delete_insn (insn);
+ delete_related_insns (insn);
continue;
}
@@ -529,7 +529,7 @@ duplicate_loop_exit_test (loop_start)
/* Mark the exit code as the virtual top of the converted loop. */
emit_note_before (NOTE_INSN_LOOP_VTOP, exitcode);
- delete_insn (next_nonnote_insn (loop_start));
+ delete_related_insns (next_nonnote_insn (loop_start));
/* Clean up. */
if (reg_map)
@@ -1710,24 +1710,24 @@ delete_computation (insn)
delete_prior_computation (note, insn);
}
- delete_insn (insn);
+ delete_related_insns (insn);
}
-/* Delete insn INSN from the chain of insns and update label ref counts.
- May delete some following insns as a consequence; may even delete
- a label elsewhere and insns that follow it.
+/* Delete insn INSN from the chain of insns and update label ref counts
+ and delete insns now unreachable.
+
+ Returns the first insn after INSN that was not deleted.
- Returns the first insn after INSN that was not deleted. */
+ Usage of this instruction is deprecated. Use delete_insn instead and
+ subsequent cfg_cleanup pass to delete unreachable code if needed. */
rtx
-delete_insn (insn)
+delete_related_insns (insn)
register rtx insn;
{
- register rtx next = NEXT_INSN (insn);
- register rtx prev = PREV_INSN (insn);
register int was_code_label = (GET_CODE (insn) == CODE_LABEL);
- register int dont_really_delete = 0;
rtx note;
+ rtx next = NEXT_INSN (insn), prev = PREV_INSN (insn);
while (next && INSN_DELETED_P (next))
next = NEXT_INSN (next);
@@ -1736,58 +1736,13 @@ delete_insn (insn)
if (INSN_DELETED_P (insn))
return next;
- if (was_code_label)
- remove_node_from_expr_list (insn, &nonlocal_goto_handler_labels);
-
- /* Don't delete user-declared labels. When optimizing, convert them
- to special NOTEs instead. When not optimizing, leave them alone. */
- if (was_code_label && LABEL_NAME (insn) != 0)
- {
- if (optimize)
- {
- const char *name = LABEL_NAME (insn);
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL;
- NOTE_SOURCE_FILE (insn) = name;
- }
-
- dont_really_delete = 1;
- }
- else
- /* Mark this insn as deleted. */
- INSN_DELETED_P (insn) = 1;
+ delete_insn (insn);
/* If instruction is followed by a barrier,
delete the barrier too. */
if (next != 0 && GET_CODE (next) == BARRIER)
- {
- INSN_DELETED_P (next) = 1;
- next = NEXT_INSN (next);
- }
-
- /* Patch out INSN (and the barrier if any) */
-
- if (! dont_really_delete)
- {
- if (prev)
- {
- NEXT_INSN (prev) = next;
- if (GET_CODE (prev) == INSN && GET_CODE (PATTERN (prev)) == SEQUENCE)
- NEXT_INSN (XVECEXP (PATTERN (prev), 0,
- XVECLEN (PATTERN (prev), 0) - 1)) = next;
- }
-
- if (next)
- {
- PREV_INSN (next) = prev;
- if (GET_CODE (next) == INSN && GET_CODE (PATTERN (next)) == SEQUENCE)
- PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = prev;
- }
-
- if (prev && NEXT_INSN (prev) == 0)
- set_last_insn (prev);
- }
+ delete_insn (next);
/* If deleting a jump, decrement the count of the label,
and delete the label if it is now unused. */
@@ -1796,12 +1751,12 @@ delete_insn (insn)
{
rtx lab = JUMP_LABEL (insn), lab_next;
- if (--LABEL_NUSES (lab) == 0)
+ if (LABEL_NUSES (lab) == 0)
{
/* This can delete NEXT or PREV,
either directly if NEXT is JUMP_LABEL (INSN),
or indirectly through more levels of jumps. */
- delete_insn (lab);
+ delete_related_insns (lab);
/* I feel a little doubtful about this loop,
but I see no clean and sure alternative way
@@ -1820,7 +1775,7 @@ delete_insn (insn)
We may not be able to kill the label immediately preceeding
just yet, as it might be referenced in code leading up to
the tablejump. */
- delete_insn (lab_next);
+ delete_related_insns (lab_next);
}
}
@@ -1835,8 +1790,8 @@ delete_insn (insn)
int len = XVECLEN (pat, diff_vec_p);
for (i = 0; i < len; i++)
- if (--LABEL_NUSES (XEXP (XVECEXP (pat, diff_vec_p, i), 0)) == 0)
- delete_insn (XEXP (XVECEXP (pat, diff_vec_p, i), 0));
+ if (LABEL_NUSES (XEXP (XVECEXP (pat, diff_vec_p, i), 0)) == 0)
+ delete_related_insns (XEXP (XVECEXP (pat, diff_vec_p, i), 0));
while (next && INSN_DELETED_P (next))
next = NEXT_INSN (next);
return next;
@@ -1848,8 +1803,8 @@ delete_insn (insn)
if (REG_NOTE_KIND (note) == REG_LABEL
/* This could also be a NOTE_INSN_DELETED_LABEL note. */
&& GET_CODE (XEXP (note, 0)) == CODE_LABEL)
- if (--LABEL_NUSES (XEXP (note, 0)) == 0)
- delete_insn (XEXP (note, 0));
+ if (LABEL_NUSES (XEXP (note, 0)) == 0)
+ delete_related_insns (XEXP (note, 0));
while (prev && (INSN_DELETED_P (prev) || GET_CODE (prev) == NOTE))
prev = PREV_INSN (prev);
@@ -1863,7 +1818,7 @@ delete_insn (insn)
&& GET_CODE (NEXT_INSN (insn)) == JUMP_INSN
&& (GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_VEC
|| GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC))
- next = delete_insn (NEXT_INSN (insn));
+ next = delete_related_insns (NEXT_INSN (insn));
/* If INSN was a label, delete insns following it if now unreachable. */
@@ -1886,7 +1841,7 @@ delete_insn (insn)
deletion of unreachable code, after a different label.
As long as the value from this recursive call is correct,
this invocation functions correctly. */
- next = delete_insn (next);
+ next = delete_related_insns (next);
}
}
@@ -2128,7 +2083,7 @@ redirect_jump (jump, nlabel, delete_unused)
emit_note_after (NOTE_INSN_FUNCTION_END, nlabel);
if (olabel && --LABEL_NUSES (olabel) == 0 && delete_unused)
- delete_insn (olabel);
+ delete_related_insns (olabel);
return 1;
}