diff options
author | Bernd Schmidt <bernd.schmidt@analog.com> | 2006-09-15 12:35:43 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2006-09-15 12:35:43 +0000 |
commit | 11b904a1fc450d9d4d9c77441aa25d0fb8a5e51b (patch) | |
tree | d8379f7b3521123e3720bfa6fc21522b1fbdfddd | |
parent | 61066abfcd5ee6e7bd580d27bde1be11992cf6f8 (diff) | |
download | gcc-11b904a1fc450d9d4d9c77441aa25d0fb8a5e51b.zip gcc-11b904a1fc450d9d4d9c77441aa25d0fb8a5e51b.tar.gz gcc-11b904a1fc450d9d4d9c77441aa25d0fb8a5e51b.tar.bz2 |
cfgrtl.c (emit_insn_at_entry): New function.
* cfgrtl.c (emit_insn_at_entry): New function.
* rtl.h (emit_insn_at_entry): Declare it.
* integrate.c (emit_initial_value_sets): Use it.
From-SVN: r116968
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 14 | ||||
-rw-r--r-- | gcc/integrate.c | 2 | ||||
-rw-r--r-- | gcc/rtl.h | 1 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d6f892c..b69961a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 <kazu@codesourcery.com> * doc/tm.texi (TARGET_FUNCTION_VALUE): Put @deftypefn all in diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index b07bb94..df281cb 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -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 diff --git a/gcc/integrate.c b/gcc/integrate.c index 9876935..a6eeede 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -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; } @@ -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); |