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
+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
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. */
+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.
--- /dev/null
+/* { 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" } */
+}