Patchwork Add testcase for PR58696

login
register
mail settings
Submitter Richard Guenther
Date Oct. 14, 2013, 9:16 a.m.
Message ID <alpine.LNX.2.00.1310141115490.5598@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/283157/
State New
Headers show

Comments

Richard Guenther - Oct. 14, 2013, 9:16 a.m.
Tested on x86_64-unknown-linux-gnu, applied.

Richard.

2013-10-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/58640
	* gcc.c-torture/execute/pr58640-2.c: New testcase.

Patch

Index: gcc/testsuite/gcc.c-torture/execute/pr58640-2.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/pr58640-2.c	(revision 0)
+++ gcc/testsuite/gcc.c-torture/execute/pr58640-2.c	(working copy)
@@ -0,0 +1,35 @@ 
+extern void abort (void);
+
+int a[20], b, c; 
+
+int
+fn1 ()
+{
+  int d, e, f, g = 0; 
+
+  a[12] = 1;
+  for (e = 0; e < 3; e++)
+    for (d = 0; d < 2; d++)
+      {
+	for (f = 0; f < 2; f++)
+	  {
+	    g ^= a[12] > 1;
+	    if (g)
+	      return 0;
+	    if (b)
+	      break;
+	  }
+	for (c = 0; c < 1; c++)
+	  a[d] = a[e * 3 + 9]; 
+      }
+  return 0;
+}
+
+int
+main ()
+{
+  fn1 ();
+  if (a[0] != 0)
+    abort ();
+  return 0;
+}