public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add PR rtl-optimization/68249 and PR rtl-optimization/68321 testcases
@ 2015-11-26 12:05 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2015-11-26 12:05 UTC (permalink / raw)
  To: gcc-patches

Hi!

These PRs are dups of PR68194 that has been fixed recently.
I've added the testcases for them to the trunk and 5 branch.

2015-11-26  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/68249
	PR rtl-optimization/68321
	* gcc.c-torture/execute/pr68249.c: New test.
	* gcc.c-torture/execute/pr68321.c: New test.

--- gcc/testsuite/gcc.c-torture/execute/pr68249.c.jj	2015-11-26 12:39:43.204789597 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr68249.c	2015-11-26 12:39:23.000000000 +0100
@@ -0,0 +1,36 @@
+/* PR rtl-optimization/68249 */
+
+int a, b, c, g, k, l, m, n;
+char h;
+
+void
+fn1 ()
+{
+  for (; k; k++)
+    {
+      m = b || c < 0 || c > 1 ? : c;
+      g = l = n || m < 0 || (m > 1) > 1 >> m ? : 1 << m;
+    }
+  l = b + 1;
+  for (; b < 1; b++)
+    h = a + 1;
+}
+
+int
+main ()
+{
+  char j; 
+  for (; a < 1; a++)
+    {
+      fn1 ();
+      if (h)
+	j = h;
+      if (j > c)
+	g = 0;
+    }
+
+  if (h != 1) 
+    __builtin_abort (); 
+
+  return 0;
+}
--- gcc/testsuite/gcc.c-torture/execute/pr68321.c.jj	2015-11-26 12:39:43.204789597 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr68321.c	2015-11-26 12:39:05.000000000 +0100
@@ -0,0 +1,38 @@
+/* PR rtl-optimization/68321 */
+
+int e = 1, u = 5, t2, t5, i, k;
+int a[1], b, m;
+char n, t;
+
+int
+fn1 (int p1)
+{
+  int g[1];
+  for (;;)
+    {
+      if (p1 / 3)
+	for (; t5;)
+	  u || n;
+      t2 = p1 & 4;
+      if (b + 1)
+	return 0;
+      u = g[0];
+    }
+}
+
+int
+main ()
+{
+  for (; e >= 0; e--)
+    {
+      char c;
+      if (!m)
+	c = t;
+      fn1 (c);
+    }
+  
+  if (a[t2] != 0) 
+    __builtin_abort (); 
+
+  return 0;
+}

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-26 11:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-26 12:05 [PATCH] Add PR rtl-optimization/68249 and PR rtl-optimization/68321 testcases Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).