diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-02 19:16:04 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-02 19:16:04 +0000 |
commit | 3d77819c1e9c627bb0c283cafbd88acfd77e87e4 (patch) | |
tree | ea75359bbaa2e28306d3a1e0dc9ed97e7d652471 /gcc/expmed.c | |
parent | b907b1fbafe1e32d26b9abe967405ef2f91ccf5c (diff) | |
download | gcc-3d77819c1e9c627bb0c283cafbd88acfd77e87e4.tar.gz |
* expmed.c (expand_divmod): Add comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121519 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index fea859a18c1..8e8a63917a1 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -4176,6 +4176,9 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, HOST_WIDE_INT d = INTVAL (op1); unsigned HOST_WIDE_INT abs_d; + /* Since d might be INT_MIN, we have to cast to + unsigned HOST_WIDE_INT before negating to avoid + undefined signed overflow. */ abs_d = (d >= 0 ? (unsigned HOST_WIDE_INT) d : - (unsigned HOST_WIDE_INT) d); |