diff mbox

[committed] : Add a testcase for PR tree-optimization/67077

Message ID 20150803165953.GA29683@intel.com
State New
Headers show

Commit Message

H.J. Lu Aug. 3, 2015, 4:59 p.m. UTC
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67077

is fixed by

https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=226089

I checked in this patch to add a testcase for PR tree-optimization/67077.
diff mbox

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 226516)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@ 
+2015-08-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR tree-optimization/67077
+	* gcc.dg/pr67077.c: New test.
+
 2015-08-03  Jeff Law  <law@redhat.com>
 
 	PR middle-end/66314
Index: gcc.dg/pr67077.c
===================================================================
--- gcc.dg/pr67077.c	(revision 0)
+++ gcc.dg/pr67077.c	(working copy)
@@ -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;
+}