aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2007-06-12 12:31:04 +0200
committerUros Bizjak <uros@gcc.gnu.org>2007-06-12 12:31:04 +0200
commit7f482dfebf0aaaf2e35e53ffe16834de4eb1d375 (patch)
tree3362e42dd7a91d98b073c7106e0c583ff2c036c8 /gcc/combine.c
parent9883e373fc9bbdf33e1913f184f3768835b88f88 (diff)
downloadgcc-7f482dfebf0aaaf2e35e53ffe16834de4eb1d375.zip
gcc-7f482dfebf0aaaf2e35e53ffe16834de4eb1d375.tar.gz
gcc-7f482dfebf0aaaf2e35e53ffe16834de4eb1d375.tar.bz2
re PR rtl-optimization/32293 (internal compiler error: in do_SUBST, at combine.c:502)
PR rtl-optimization/32293 * combine.c (simplify_if_then_else): Truncate return from nonzero_bits() to correct mode. testsuite/ChangeLog: PR rtl-optimization/32293 * gcc.dg/pr32293.c: New test. From-SVN: r125643
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index d7ac8ad..6fbf816 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5210,11 +5210,17 @@ simplify_if_then_else (rtx x)
if (true_code == EQ && true_val == const0_rtx
&& exact_log2 (nzb = nonzero_bits (from, GET_MODE (from))) >= 0)
- false_code = EQ, false_val = GEN_INT (nzb);
+ {
+ false_code = EQ;
+ false_val = GEN_INT (trunc_int_for_mode (nzb, GET_MODE (from)));
+ }
else if (true_code == EQ && true_val == const0_rtx
&& (num_sign_bit_copies (from, GET_MODE (from))
== GET_MODE_BITSIZE (GET_MODE (from))))
- false_code = EQ, false_val = constm1_rtx;
+ {
+ false_code = EQ;
+ false_val = constm1_rtx;
+ }
/* Now simplify an arm if we know the value of the register in the
branch and it is used in the arm. Be careful due to the potential