diff options
author | James A. Morrison <phython@gcc.gnu.org> | 2005-04-19 02:36:04 +0000 |
---|---|---|
committer | James A. Morrison <phython@gcc.gnu.org> | 2005-04-19 02:36:04 +0000 |
commit | a3885f54770e771ad67808dbaa63704cc42315a6 (patch) | |
tree | c37f608d891d766338618242c956dd8f7c24ea1a /gcc/fold-const.c | |
parent | f4d7734c5741448450096985f544ea820ebc680e (diff) | |
download | gcc-a3885f54770e771ad67808dbaa63704cc42315a6.zip gcc-a3885f54770e771ad67808dbaa63704cc42315a6.tar.gz gcc-a3885f54770e771ad67808dbaa63704cc42315a6.tar.bz2 |
re PR middle-end/21085 (Virtual memory exhausted with g++)
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.
From-SVN: r98365
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 1e1ecc1..bbd14c0 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. */ |