From 1d9f8a102064449d400eee6780a777d2865c1aa0 Mon Sep 17 00:00:00 2001 From: hjl Date: Mon, 3 Aug 2015 16:58:03 +0000 Subject: [PATCH] Add a testcase for PR tree-optimization/67077 PR tree-optimization/67077 * gcc.dg/pr67077.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226518 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr67077.c | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr67077.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0a841b51398..44d7eb95882 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-08-03 H.J. Lu + + PR tree-optimization/67077 + * gcc.dg/pr67077.c: New test. + 2015-08-03 Jeff Law PR middle-end/66314 diff --git a/gcc/testsuite/gcc.dg/pr67077.c b/gcc/testsuite/gcc.dg/pr67077.c new file mode 100644 index 00000000000..555b1e3a04a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr67077.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-Wall -O2" } */ + +unsigned char buffer[8]; +unsigned long +foo (void) +{ + unsigned long i; + i = buffer[0]; + if (i >= 8) + return i - 7; + i++; + while (i > 8) + { + if (buffer[i-1] != 0) + return 0; + i--; + } + return 1; +} -- 2.11.4.GIT