aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-03-05 23:13:58 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-05 23:13:58 +0100
commit9a25c5ce6e2677ae33ba489bd18335332f5e2560 (patch)
treec7c2c5cdf293033049f224f00c35f10f0d73b21d /gcc/combine.c
parent46cf7fa13bc81496856b23f9100d76b8bfbbb437 (diff)
downloadgcc-9a25c5ce6e2677ae33ba489bd18335332f5e2560.zip
gcc-9a25c5ce6e2677ae33ba489bd18335332f5e2560.tar.gz
gcc-9a25c5ce6e2677ae33ba489bd18335332f5e2560.tar.bz2
re PR target/84700 (ICE on 32-bit BE powerpc targets w/ -misel -O1)
PR target/84700 * combine.c (combine_simplify_rtx): Don't try to simplify if if_then_else_cond returned non-NULL, but either true_rtx or false_rtx are equal to x. * gcc.target/powerpc/pr84700.c: New test. From-SVN: r258263
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index ddea5b1..a4efd11 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5734,7 +5734,11 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest,
/* If everything is a comparison, what we have is highly unlikely
to be simpler, so don't use it. */
&& ! (COMPARISON_P (x)
- && (COMPARISON_P (true_rtx) || COMPARISON_P (false_rtx))))
+ && (COMPARISON_P (true_rtx) || COMPARISON_P (false_rtx)))
+ /* Similarly, if we end up with one of the expressions the same
+ as the original, it is certainly not simpler. */
+ && ! rtx_equal_p (x, true_rtx)
+ && ! rtx_equal_p (x, false_rtx))
{
rtx cop1 = const0_rtx;
enum rtx_code cond_code = simplify_comparison (NE, &cond, &cop1);