mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 10:10:39 +08:00
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
This commit is contained in:
parent
f4d7734c57
commit
a3885f5477
@ -1,3 +1,9 @@
|
||||
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.
|
||||
|
||||
2005-04-19 Ben Elliston <bje@au.ibm.com>
|
||||
|
||||
* doc/invoke.texi (Optimize Options): Refer to the correct
|
||||
|
@ -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. */
|
||||
|
@ -1,3 +1,7 @@
|
||||
2005-04-18 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
* gcc.dg/pr21085.c: New test.
|
||||
|
||||
2005-04-18 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* gcc.target/mips/mips.exp: Minor formatting. Call setup_mips_tests.
|
||||
|
9
gcc/testsuite/gcc.dg/pr21085.c
Normal file
9
gcc/testsuite/gcc.dg/pr21085.c
Normal file
@ -0,0 +1,9 @@
|
||||
/* { dg-do compile } */
|
||||
/* This used to cause excessive use, or a stack overflow, depending on which
|
||||
came first. */
|
||||
void foo (void)
|
||||
{
|
||||
int maxstringlen = 1;
|
||||
int limit = 0, maxblock = 0, maxblockrem = 0;
|
||||
maxblockrem = (maxstringlen) % (2147483647 + 1); /* { dg-warning "overflow" } */
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user