aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2009-12-30 04:27:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2009-12-30 04:27:55 +0000
commitf6c1336cbe8141888509784439820059577d71e6 (patch)
tree03d1858f5536ff744bb7faa4ecf0079b08f752d4 /gcc/expmed.c
parent53bc54ecc08c35b05c33cf3493c90af73bcc6478 (diff)
downloadgcc-f6c1336cbe8141888509784439820059577d71e6.zip
gcc-f6c1336cbe8141888509784439820059577d71e6.tar.gz
gcc-f6c1336cbe8141888509784439820059577d71e6.tar.bz2
re PR middle-end/42099 (Error in 64-bit division for 32-bit target)
./: PR middle-end/42099 * expmed.c (expand_divmod): Don't shift HOST_WIDE_INT value more than HOST_BITS_PER_WIDE_INT. testsuite/: PR middle-end/42099 * gcc.c-torture/execute/20091229-1.c: New test. From-SVN: r155516
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index d51b454..d1fea08 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -4194,7 +4194,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
else if (d == -1)
quotient = expand_unop (compute_mode, neg_optab, op0,
tquotient, 0);
- else if (abs_d == (unsigned HOST_WIDE_INT) 1 << (size - 1))
+ else if (HOST_BITS_PER_WIDE_INT >= size
+ && abs_d == (unsigned HOST_WIDE_INT) 1 << (size - 1))
{
/* This case is not handled correctly below. */
quotient = emit_store_flag (tquotient, EQ, op0, op1,