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/testsuite/gcc.dg/pr21085.c | |
parent | 57f341e362d87e092154fbfc463e7bca8c656bd3 (diff) | |
download | gcc-6ddaa100f3fb6e330bce20314c548a789fcbc62a.tar.gz |
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/testsuite/gcc.dg/pr21085.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr21085.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr21085.c b/gcc/testsuite/gcc.dg/pr21085.c new file mode 100644 index 00000000000..6a51adb9055 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr21085.c @@ -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" } */ +} |