From: Kugan Vivekanandarajah Date: Mon, 18 Aug 2014 06:28:35 +0000 (+0000) Subject: re PR tree-optimization/52904 (-Wstrict-overflow false alarm with bounded loop) X-Git-Tag: releases/gcc-5.1.0~5425 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=495e77b35b09f0ff8d347bceb06deaa2dc72602b;p=thirdparty%2Fgcc.git re PR tree-optimization/52904 (-Wstrict-overflow false alarm with bounded loop) gcc/testsuite 2014-08-18 Kugan Vivekanandarajah PR tree-optimization/52904 * gcc.dg/pr52904.c: New test. From-SVN: r214084 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f00434267c0a..87f51d54fdb0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-08-18 Kugan Vivekanandarajah + + PR tree-optimization/52904 + * gcc.dg/pr52904.c: New test. + 2014-08-17 Tobias Burnus * gfortran.dg/finalize_27.f90: New. diff --git a/gcc/testsuite/gcc.dg/pr52904.c b/gcc/testsuite/gcc.dg/pr52904.c new file mode 100644 index 000000000000..107d89ee7d35 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr52904.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-Wstrict-overflow -O2" } */ +extern int foo (int); + +int +wait_reading_process_output (void) +{ + int nfds = 0; + int channel; + + for (channel = 0; channel < 1024; ++channel) + { + if (foo (channel)) + nfds++; + } + + if (nfds < 0) /* { dg-bogus "assuming signed overflow does not occur" } */ + return 1; + return 0; +}