Skip to content

Commit

Permalink
* cfgrtl.c (emit_insn_at_entry): New function.
Browse files Browse the repository at this point in the history
	* rtl.h (emit_insn_at_entry): Declare it.
	* integrate.c (emit_initial_value_sets): Use it.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116968 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
bernds committed Sep 15, 2006
1 parent ff7e43a commit aa02fa1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
expanding the number of iterations.
* config/bfin/bfin.c (bfin_rtx_costs): Handle UDIV, UMOD.

* cfgrtl.c (emit_insn_at_entry): New function.
* rtl.h (emit_insn_at_entry): Declare it.
* integrate.c (emit_initial_value_sets): Use it.

2006-09-15 Kazu Hirata <[email protected]>

* doc/tm.texi (TARGET_FUNCTION_VALUE): Put @deftypefn all in
Expand Down
14 changes: 14 additions & 0 deletions gcc/cfgrtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,20 @@ entry_of_function (void)
BB_HEAD (ENTRY_BLOCK_PTR->next_bb) : get_insns ());
}

/* Emit INSN at the entry point of the function, ensuring that it is only
executed once per function. */
void
emit_insn_at_entry (rtx insn)
{
edge_iterator ei = ei_start (ENTRY_BLOCK_PTR->succs);
edge e = ei_safe_edge (ei);
if (!(e->flags & EDGE_FALLTHRU))
abort ();

insert_insn_on_edge (insn, e);
commit_edge_insertions ();
}

/* Update insns block within BB. */

void
Expand Down
2 changes: 1 addition & 1 deletion gcc/integrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ emit_initial_value_sets (void)
seq = get_insns ();
end_sequence ();

emit_insn_after (seq, entry_of_function ());
emit_insn_at_entry (seq);
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions gcc/rtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,7 @@ extern rtx emit (rtx);
extern void renumber_insns (void);
extern rtx delete_insn (rtx);
extern rtx entry_of_function (void);
extern void emit_insn_at_entry (rtx);
extern void delete_insn_chain (rtx, rtx);
extern rtx unlink_insn_chain (rtx, rtx);
extern rtx delete_insn_and_edges (rtx);
Expand Down

0 comments on commit aa02fa1

Please sign in to comment.