diff options
author | phython <phython@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-19 02:36:04 +0000 |
---|---|---|
committer | phython <phython@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-19 02:36:04 +0000 |
commit | 6ddaa100f3fb6e330bce20314c548a789fcbc62a (patch) | |
tree | c37f608d891d766338618242c956dd8f7c24ea1a /gcc/fold-const.c | |
parent | 57f341e362d87e092154fbfc463e7bca8c656bd3 (diff) | |
download | ppe42-gcc-6ddaa100f3fb6e330bce20314c548a789fcbc62a.tar.gz ppe42-gcc-6ddaa100f3fb6e330bce20314c548a789fcbc62a.zip |
2005-04-18 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/21085
* fold-const (fold_binary): Don't change X % -C to X % C if C has
overflowed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98365 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 1e1ecc1470b..bbd14c0177e 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -8504,6 +8504,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (code == TRUNC_MOD_EXPR && !TYPE_UNSIGNED (type) && TREE_CODE (arg1) == INTEGER_CST + && !TREE_CONSTANT_OVERFLOW (arg1) && TREE_INT_CST_HIGH (arg1) < 0 && !flag_trapv /* Avoid this transformation if C is INT_MIN, i.e. C == -C. */ |