diff options
author | Ian Lance Taylor <iant@google.com> | 2007-03-08 17:36:05 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2007-03-08 17:36:05 +0000 |
commit | 0c948c27462a668b4e01f7841c0cca812fbbdd8c (patch) | |
tree | fa8cc8f84a345de54e6ab532ecec5b191cd7a5ca /gcc/testsuite/gcc.dg/Wstrict-overflow-13.c | |
parent | 3c2d980c94357e2a020597a47cee0ee1c2458be7 (diff) | |
download | gcc-0c948c27462a668b4e01f7841c0cca812fbbdd8c.zip gcc-0c948c27462a668b4e01f7841c0cca812fbbdd8c.tar.gz gcc-0c948c27462a668b4e01f7841c0cca812fbbdd8c.tar.bz2 |
tree-vrp.c: Include "intl.h".
./: * tree-vrp.c: Include "intl.h".
(usable_range_p): New static function.
(compare_values_warnv): Don't test TYPE_OVERFLOW_UNDEFINED for
overflowed values, juts set *strict_overflow_p.
(compare_values): Only return -2 if one of the operands is not a
constant.
(compare_ranges): Call usable_range_p.
(compare_range_with_value): Likewise.
(vrp_evaluate_conditional_warnv): Rename from
vrp_evaluate_conditional. Make static. Change all callers.
(vrp_evaluate_conditional): New function.
(simplify_div_or_mod_using_ranges): Issue warning about reliance
on signed overflow.
(simplify_abs_using_ranges): Likewise.
(simplify_stmt_for_jump_threading): Add within_stmt parameter.
* tree-ssa-dom.c (simplify_stmt_for_jump_threading): Add
within_stmt parameter.
* tree-ssa-propagate.c (fold_predicate_in): Update call to
vrp_evaluate_conditional.
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts_at_dest): Change
simplify parameter to take a second tree parameter.
(simplify_control_stmt_condition): Likewise.
(thread_across_edge): Likewise.
* tree-flow.h (vrp_evaluate_conditional): Update declaration.
(thread_across_edge): Likewise.
* gcc/Makefile.in (tree-vrp.o): Depend upon intl.h.
testsuite/:
* gcc.dg/no-strict-overflow-5.c: New test.
* gcc.dg/no-strict-overflow-6.c: New test.
* gcc.dg/Wstrict-overflow-11.c: New test.
* gcc.dg/Wstrict-overflow-12.c: New test.
* gcc.dg/Wstrict-overflow-13.c: New test.
* gcc.dg/Wstrict-overflow-14.c: New test.
* gcc.dg/Wstrict-overflow-15.c: New test.
From-SVN: r122706
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wstrict-overflow-13.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-overflow-13.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-13.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-13.c new file mode 100644 index 0000000..170d137 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-13.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2" } */ + +/* Source: Ian Lance Taylor. Dual of no-strict-overflow-6.c. */ + +/* VRP test. This turns into an infinite loop (depending on what + bigtime_test does), but at least we warn about it. */ + +extern int bigtime_test (int); +int +foo () +{ + int j; + for (j = 1; 0 < j; j *= 2) /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */ + if (! bigtime_test (j)) + return 1; + return 0; +} |