public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add testcase for tree-optimization/67916
@ 2015-12-01 15:18 Marek Polacek
  2015-12-01 15:28 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Polacek @ 2015-12-01 15:18 UTC (permalink / raw)
  To: GCC Patches

This PR was fixed in r228767 (or went latent?), but this testcase has never
been added.

Tested on x86_64-linux, ok for trunk?

2015-12-01  Marek Polacek  <polacek@redhat.com>

	PR tree-optimization/67916
	* gcc.dg/torture/pr67916.c: New test.

diff --git gcc/testsuite/gcc.dg/torture/pr67916.c gcc/testsuite/gcc.dg/torture/pr67916.c
index e69de29..88541f9 100644
--- gcc/testsuite/gcc.dg/torture/pr67916.c
+++ gcc/testsuite/gcc.dg/torture/pr67916.c
@@ -0,0 +1,46 @@
+/* PR tree-optimization/67916 */
+/* { dg-do run } */
+
+int a[6], b = 1, d, e;
+long long c;
+static int f = 1;
+
+void
+fn1 (int p1)
+{
+  b = (b >> 1) & (1 ^ a[(1 ^ p1) & 5]);
+}
+
+void
+fn2 ()
+{
+  b = (b >> 1) & (1 ^ a[(b ^ 1) & 1]);
+  fn1 (c >> 1 & 5);
+  fn1 (c >> 2 & 5);
+  fn1 (c >> 4 & 5);
+  fn1 (c >> 8 & 5);
+}
+
+int
+main ()
+{
+  int i, j;
+  for (; d;)
+    {
+      for (; e;)
+	fn2 ();
+      f = 0;
+    }
+  for (i = 0; i < 8; i++)
+    {
+      if (f)
+	i = 9;
+      for (j = 0; j < 7; j++)
+	fn2 ();
+    }
+
+  if (b != 0)
+    __builtin_abort ();
+
+  return 0;
+}

	Marek

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add testcase for tree-optimization/67916
  2015-12-01 15:18 [PATCH] Add testcase for tree-optimization/67916 Marek Polacek
@ 2015-12-01 15:28 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-12-01 15:28 UTC (permalink / raw)
  To: Marek Polacek; +Cc: GCC Patches

On Tue, Dec 1, 2015 at 4:18 PM, Marek Polacek <polacek@redhat.com> wrote:
> This PR was fixed in r228767 (or went latent?), but this testcase has never
> been added.
>
> Tested on x86_64-linux, ok for trunk?

Ok.

Richard.

> 2015-12-01  Marek Polacek  <polacek@redhat.com>
>
>         PR tree-optimization/67916
>         * gcc.dg/torture/pr67916.c: New test.
>
> diff --git gcc/testsuite/gcc.dg/torture/pr67916.c gcc/testsuite/gcc.dg/torture/pr67916.c
> index e69de29..88541f9 100644
> --- gcc/testsuite/gcc.dg/torture/pr67916.c
> +++ gcc/testsuite/gcc.dg/torture/pr67916.c
> @@ -0,0 +1,46 @@
> +/* PR tree-optimization/67916 */
> +/* { dg-do run } */
> +
> +int a[6], b = 1, d, e;
> +long long c;
> +static int f = 1;
> +
> +void
> +fn1 (int p1)
> +{
> +  b = (b >> 1) & (1 ^ a[(1 ^ p1) & 5]);
> +}
> +
> +void
> +fn2 ()
> +{
> +  b = (b >> 1) & (1 ^ a[(b ^ 1) & 1]);
> +  fn1 (c >> 1 & 5);
> +  fn1 (c >> 2 & 5);
> +  fn1 (c >> 4 & 5);
> +  fn1 (c >> 8 & 5);
> +}
> +
> +int
> +main ()
> +{
> +  int i, j;
> +  for (; d;)
> +    {
> +      for (; e;)
> +       fn2 ();
> +      f = 0;
> +    }
> +  for (i = 0; i < 8; i++)
> +    {
> +      if (f)
> +       i = 9;
> +      for (j = 0; j < 7; j++)
> +       fn2 ();
> +    }
> +
> +  if (b != 0)
> +    __builtin_abort ();
> +
> +  return 0;
> +}
>
>         Marek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-01 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01 15:18 [PATCH] Add testcase for tree-optimization/67916 Marek Polacek
2015-12-01 15:28 ` Richard Biener

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).