diff options
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); } |