diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-02 17:07:15 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-02 17:07:15 +0000 |
commit | 4547eca67f102b9a7705a3e6259f48d993f79b7a (patch) | |
tree | 5ef681ee68f0e49503bc7fb851a8a95b133b3c40 /gcc/cfgexpand.c | |
parent | 0d3a8ed498b9bae354a81e2868c6b47ad107bde4 (diff) | |
download | gcc-4547eca67f102b9a7705a3e6259f48d993f79b7a.tar.gz |
PR rtl-optimization/47028
* cfgexpand.c (gimple_expand_cfg): Insert entry edge
insertions after parm_birth_insn instead of at the beginning
of first bb.
* gcc.dg/pr47028.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168401 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index a3940d01775..13c63be12ef 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -4085,7 +4085,19 @@ gimple_expand_cfg (void) for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) { if (e->insns.r) - commit_one_edge_insertion (e); + { + /* Avoid putting insns before parm_birth_insn. */ + if (e->src == ENTRY_BLOCK_PTR + && single_succ_p (ENTRY_BLOCK_PTR) + && parm_birth_insn) + { + rtx insns = e->insns.r; + e->insns.r = NULL_RTX; + emit_insn_after_noloc (insns, parm_birth_insn, e->dest); + } + else + commit_one_edge_insertion (e); + } else ei_next (&ei); } |