* tree-vrp.c (compare_name_with_value): Always set
used_strict_overflow if we get a result from the variable itself.
testsuite/:
* gcc.dg/Wstrict-overflow-17.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125269
138bc75d-0d04-0410-961f-
82ee72b054a4
2007-06-01 Ian Lance Taylor <iant@google.com>
+ * tree-vrp.c (compare_name_with_value): Always set
+ used_strict_overflow if we get a result from the variable itself.
+
+2007-06-01 Ian Lance Taylor <iant@google.com>
+
PR rtl-optimization/31455
* lower-subreg.c (find_decomposable_subregs): Don't decompose
subregs which have a cast between modes which are not tieable.
+2007-06-01 Ian Lance Taylor <iant@google.com>
+
+ * gcc.dg/Wstrict-overflow-17.c: New test.
+
2007-06-01 Kazu Hirata <kazu@codesourcery.com>
* gcc.dg/builtin-return-1.c (g): New.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+
+/* This erroneously gave an overflow warning. */
+
+extern void bar (char);
+void
+foo (char *s)
+{
+ int len, i;
+
+ for (len = 1; len < 5000; ++len)
+ {
+ for (i = 0; i < len; ++i)
+ {
+ if (s[i] != '\0')
+ bar (s[i]);
+ }
+ }
+}
equiv_vr = get_vr_for_comparison (SSA_NAME_VERSION (var));
sop = false;
retval = compare_range_with_value (comp, &equiv_vr, val, &sop);
- if (sop)
- used_strict_overflow = 1;
+ if (retval)
+ used_strict_overflow = sop ? 1 : 0;
/* If the equiv set is empty we have done all work we need to do. */
if (e == NULL)