Commit e07e405d by Ian Lance Taylor Committed by Ian Lance Taylor

tree-vrp.c (compare_name_with_value): Always set used_strict_overflow if we get…

tree-vrp.c (compare_name_with_value): Always set used_strict_overflow if we get a result from the variable itself.

./:	* 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.

From-SVN: r125269
parent 069a73f9
2007-06-01 Ian Lance Taylor <iant@google.com> 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 PR rtl-optimization/31455
* lower-subreg.c (find_decomposable_subregs): Don't decompose * lower-subreg.c (find_decomposable_subregs): Don't decompose
subregs which have a cast between modes which are not tieable. 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> 2007-06-01 Kazu Hirata <kazu@codesourcery.com>
* gcc.dg/builtin-return-1.c (g): New. * gcc.dg/builtin-return-1.c (g): New.
/* { 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]);
}
}
}
...@@ -4676,8 +4676,8 @@ compare_name_with_value (enum tree_code comp, tree var, tree val, ...@@ -4676,8 +4676,8 @@ compare_name_with_value (enum tree_code comp, tree var, tree val,
equiv_vr = get_vr_for_comparison (SSA_NAME_VERSION (var)); equiv_vr = get_vr_for_comparison (SSA_NAME_VERSION (var));
sop = false; sop = false;
retval = compare_range_with_value (comp, &equiv_vr, val, &sop); retval = compare_range_with_value (comp, &equiv_vr, val, &sop);
if (sop) if (retval)
used_strict_overflow = 1; used_strict_overflow = sop ? 1 : 0;
/* If the equiv set is empty we have done all work we need to do. */ /* If the equiv set is empty we have done all work we need to do. */
if (e == NULL) if (e == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment