aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2007-05-17 15:29:10 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-05-17 13:29:10 +0000
commit4eff80454bb64e2fd93336cb021695f7453cd41a (patch)
tree0aafa5bab3ec3b34d8e06253401a45d19656466b /gcc/combine.c
parent0881653ce25559ff10a7f8d5832f8d120eb27568 (diff)
downloadgcc-4eff80454bb64e2fd93336cb021695f7453cd41a.zip
gcc-4eff80454bb64e2fd93336cb021695f7453cd41a.tar.gz
gcc-4eff80454bb64e2fd93336cb021695f7453cd41a.tar.bz2
re PR rtl-optimization/31691 (optimized code taking the wrong branch)
PR rtl-optimization/31691 * combine.c (simplify_set): Build a new src pattern instead of substituting its operands in the COMPARE case. From-SVN: r124797
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 99da26d..7589aac 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5343,14 +5343,14 @@ simplify_set (rtx x)
}
else if (GET_MODE (op0) == compare_mode && op1 == const0_rtx)
{
- SUBST(SET_SRC (x), op0);
+ SUBST (SET_SRC (x), op0);
src = SET_SRC (x);
}
- else
+ /* Otherwise, update the COMPARE if needed. */
+ else if (XEXP (src, 0) != op0 || XEXP (src, 1) != op1)
{
- /* Otherwise, update the COMPARE if needed. */
- SUBST (XEXP (src, 0), op0);
- SUBST (XEXP (src, 1), op1);
+ SUBST (SET_SRC (x), gen_rtx_COMPARE (compare_mode, op0, op1));
+ src = SET_SRC (x);
}
}
else