aboutsummaryrefslogtreecommitdiff
path: root/gcc/sel-sched.c
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@gcc.gnu.org>2010-01-14 13:16:01 +0300
committerAndrey Belevantsev <abel@gcc.gnu.org>2010-01-14 13:16:01 +0300
commit0666ff4e33e39bd94ea8f34bf4ef1af1a004bd53 (patch)
treeb6b0f57b7fe8c4e2385e76f5fba5877465ba91fe /gcc/sel-sched.c
parent5f8d50239ba11866a5e0251975142fee6632ab2f (diff)
downloadgcc-0666ff4e33e39bd94ea8f34bf4ef1af1a004bd53.zip
gcc-0666ff4e33e39bd94ea8f34bf4ef1af1a004bd53.tar.gz
gcc-0666ff4e33e39bd94ea8f34bf4ef1af1a004bd53.tar.bz2
re PR rtl-optimization/42294 (ICE in code_motion_path_driver for 416.gamess)
PR rtl-optimization/42294 * sel-sched.c (try_replace_dest_reg): When chosen register and original register is the same, do not bail out early, but still check all original insns for validity of replacing destination register. Set EXPR_TARGET_AVAILABLE to 1 before leaving function in this case. From-SVN: r155889
Diffstat (limited to 'gcc/sel-sched.c')
-rw-r--r--gcc/sel-sched.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index e5ebc57..27c0f21 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -1642,14 +1642,6 @@ collect_unavailable_regs_from_bnds (expr_t expr, blist_t bnds, regset used_regs,
static bool
try_replace_dest_reg (ilist_t orig_insns, rtx best_reg, expr_t expr)
{
- if (expr_dest_regno (expr) == REGNO (best_reg))
- {
- EXPR_TARGET_AVAILABLE (expr) = 1;
- return true;
- }
-
- gcc_assert (orig_insns);
-
/* Try whether we'll be able to generate the insn
'dest := best_reg' at the place of the original operation. */
for (; orig_insns; orig_insns = ILIST_NEXT (orig_insns))
@@ -1658,14 +1650,19 @@ try_replace_dest_reg (ilist_t orig_insns, rtx best_reg, expr_t expr)
gcc_assert (EXPR_SEPARABLE_P (INSN_EXPR (orig_insn)));
- if (!replace_src_with_reg_ok_p (orig_insn, best_reg)
- || !replace_dest_with_reg_ok_p (orig_insn, best_reg))
+ if (REGNO (best_reg) != REGNO (INSN_LHS (orig_insn))
+ && (! replace_src_with_reg_ok_p (orig_insn, best_reg)
+ || ! replace_dest_with_reg_ok_p (orig_insn, best_reg)))
return false;
}
/* Make sure that EXPR has the right destination
register. */
- replace_dest_with_reg_in_expr (expr, best_reg);
+ if (expr_dest_regno (expr) != REGNO (best_reg))
+ replace_dest_with_reg_in_expr (expr, best_reg);
+ else
+ EXPR_TARGET_AVAILABLE (expr) = 1;
+
return true;
}