Commit e4c9f3c2 by Ian Lance Taylor Committed by Ian Lance Taylor

expmed.c (expand_divmod): Cast constant to unsigned HOST_WIDE_INT before negating.

	* expmed.c (expand_divmod) [TRUNC_MOD_EXPR, TRUNC_DIV_EXPR]: Cast
	constant to unsigned HOST_WIDE_INT before negating.

From-SVN: r120995
parent b2bcf557
2007-01-19 Ian Lance Taylor <iant@google.com> 2007-01-19 Ian Lance Taylor <iant@google.com>
* expmed.c (expand_divmod) [TRUNC_MOD_EXPR, TRUNC_DIV_EXPR]: Cast
constant to unsigned HOST_WIDE_INT before negating.
2007-01-19 Ian Lance Taylor <iant@google.com>
* tree-ssa-operands.h (struct vuse_vec_d): Change num_vuse field * tree-ssa-operands.h (struct vuse_vec_d): Change num_vuse field
to unsigned. to unsigned.
(VUSE_VECT_ELEMENT) [ENABLE_CHECKING]: Use unsigned comparison. (VUSE_VECT_ELEMENT) [ENABLE_CHECKING]: Use unsigned comparison.
......
/* Medium-level subroutines: convert bit-field store and extract /* Medium-level subroutines: convert bit-field store and extract
and shifts, multiplies and divides to rtl instructions. and shifts, multiplies and divides to rtl instructions.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 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. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -4174,7 +4174,9 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4174,7 +4174,9 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
int lgup, post_shift; int lgup, post_shift;
rtx mlr; rtx mlr;
HOST_WIDE_INT d = INTVAL (op1); 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 */ /* n rem d = n rem -d */
if (rem_flag && d < 0) if (rem_flag && d < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment