diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-17 16:27:23 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-17 16:27:23 +0000 |
commit | 9ce07db490abc09e2b306cb4e072b41e48e226f9 (patch) | |
tree | 59b7a6a0cee6416860e6abdc8853fc758f102954 | |
parent | a5b5a55aaa7d738765cd08d6783ac38bf88d3036 (diff) |
PR tree-optimizatoin/51083
* gcc.c-torture/compile/pr51083.c: New testcase.
* loop-iv.c (iv_number_of_iterations): Consider zero iteration case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195274 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/loop-iv.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr51083.c | 18 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1bf9288ee9b..c30e4d43620 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-01-17 Jan Hubicka <jh@suse.cz> + + PR tree-optimization/51083 + * loop-iv.c (iv_number_of_iterations): Consider zero iteration case. + 2012-01-17 Uros Bizjak <ubizjak@gmail.com> PR target/55981 diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 62a3c6f03e5..15f16619863 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -2819,7 +2819,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, else { max = determine_max_iter (loop, desc, old_niter); - gcc_assert (max); + if (!max) + goto zero_iter_simplify; if (!desc->infinite && !desc->assumptions) record_niter_bound (loop, double_int::from_uhwi (max), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dc25943f8cd..108f308629b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-01-17 Jan Hubicka <jh@suse.cz> + + PR tree-optimization/51083 + * gcc.c-torture/compile/pr51083.c: New testcase. + 2012-01-17 Uros Bizjak <ubizjak@gmail.com> PR target/55981 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr51083.c b/gcc/testsuite/gcc.c-torture/compile/pr51083.c new file mode 100644 index 00000000000..8ae5199b789 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr51083.c @@ -0,0 +1,18 @@ +extern int debug_threads; +extern void sigsuspend (void); +void my_waitpid (int flags, int wnohang) +{ + while (1) + { + if (flags & 0x80000000) + { + if (wnohang) + break; + if (debug_threads) + __builtin_puts ("blocking\n"); + sigsuspend (); + } + flags ^= 0x80000000; + } +} + |