summaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-30 04:27:55 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-30 04:27:55 +0000
commit6115f2433783cd5d09d0f3e562d759d792fa49e2 (patch)
tree03d1858f5536ff744bb7faa4ecf0079b08f752d4 /gcc/expmed.c
parent67476d8b8a8602a4c078dadb7db0d263e62eda1d (diff)
downloadgcc-6115f2433783cd5d09d0f3e562d759d792fa49e2.tar.gz
./:
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155516 138bc75d-0d04-0410-961f-82ee72b054a4
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 d51b4542677..d1fea0818c2 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,