This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] combine: Use correct mode in new comparison (PR86902)
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Wed, 19 Sep 2018 17:35:07 +0000
- Subject: [PATCH] combine: Use correct mode in new comparison (PR86902)
This code in try_combine uses the wrong mode. This fails (with RTL
checking) in trunk, but not in any released branches.
Committing to trunk.
Segher
2018-09-19 Segher Boessenkool <segher@kernel.crashing.org>
* combine.c (try_combine): When changing the CC mode used, don't change
an unrelated mode in other_insn to that new CC mode.
---
gcc/combine.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/combine.c b/gcc/combine.c
index d3f7143..256b5a4 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -3338,7 +3338,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
{
/* Replace cc_use_loc with entire new RTX. */
SUBST (*cc_use_loc,
- gen_rtx_fmt_ee (compare_code, compare_mode,
+ gen_rtx_fmt_ee (compare_code, GET_MODE (*cc_use_loc),
newpat_dest, const0_rtx));
undobuf.other_insn = cc_use_insn;
}
@@ -3347,7 +3347,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
/* Just replace the CC reg with a new mode. */
SUBST (XEXP (*cc_use_loc, 0), newpat_dest);
undobuf.other_insn = cc_use_insn;
- }
+ }
}
/* Now we modify the current newpat:
--
1.8.3.1