aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernd.schmidt@analog.com>2006-09-15 12:35:43 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2006-09-15 12:35:43 +0000
commit11b904a1fc450d9d4d9c77441aa25d0fb8a5e51b (patch)
treed8379f7b3521123e3720bfa6fc21522b1fbdfddd /gcc/cfgrtl.c
parent61066abfcd5ee6e7bd580d27bde1be11992cf6f8 (diff)
downloadgcc-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
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c14
1 files changed, 14 insertions, 0 deletions
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