diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-20 02:04:31 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-20 02:04:31 +0000 |
commit | f74f4e04a6a5bb91924147720fd36921df06fa75 (patch) | |
tree | 6671e8dda9ef65f73642aeb937c81c8691ab78a2 /gcc/expmed.c | |
parent | aa1fb45938d2d5dc0fe97f15f3a88a8430fd265c (diff) | |
download | gcc-f74f4e04a6a5bb91924147720fd36921df06fa75.tar.gz |
* expmed.c (expand_divmod) [TRUNC_MOD_EXPR, TRUNC_DIV_EXPR]: Cast
constant to unsigned HOST_WIDE_INT before negating.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120995 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index e12fdfbb103..58b6a635a6a 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1,7 +1,7 @@ /* Medium-level subroutines: convert bit-field store and extract and shifts, multiplies and divides to rtl instructions. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. @@ -4174,7 +4174,9 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, int lgup, post_shift; rtx mlr; HOST_WIDE_INT d = INTVAL (op1); - unsigned HOST_WIDE_INT abs_d = d >= 0 ? d : -d; + unsigned HOST_WIDE_INT abs_d; + + abs_d = d >= 0 ? d : - (unsigned HOST_WIDE_INT) d; /* n rem d = n rem -d */ if (rem_flag && d < 0) |