diff options
author | obrien <obrien@FreeBSD.org> | 2007-12-11 03:35:39 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2007-12-11 03:35:39 +0000 |
commit | 436a93024264937812e640ef90fafffe1587c715 (patch) | |
tree | 5108b706c8903a1a66765ad2ecdca3702c6b2371 /contrib | |
parent | b162aa2e5ac107cf3b97741e44870bb56d7c6d95 (diff) | |
download | FreeBSD-src-436a93024264937812e640ef90fafffe1587c715.zip FreeBSD-src-436a93024264937812e640ef90fafffe1587c715.tar.gz |
Do not fold -C*ABS<n> to ABS<-C*n> (i.e., do not move negative constants
inside ABS expression).
Obtained from: Richard Guenther <rguenther@suse.de>
Approved by: core
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/gcc/fold-const.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/gcc/fold-const.c b/contrib/gcc/fold-const.c index 5db1d84..ea16eae 100644 --- a/contrib/gcc/fold-const.c +++ b/contrib/gcc/fold-const.c @@ -5661,6 +5661,9 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type, } break; } + /* If the constant is negative, we cannot simplify this. */ + if (tree_int_cst_sgn (c) == -1) + break; /* FALLTHROUGH */ case NEGATE_EXPR: if ((t1 = extract_muldiv (op0, c, code, wide_type, strict_overflow_p)) |