Patchwork Add testcase for PR57478

login
register
mail settings
Submitter Marek Polacek
Date May 31, 2013, 10:50 a.m.
Message ID <20130531105028.GA4160@redhat.com>
Download mbox | patch
Permalink /patch/247916/
State New
Headers show

Comments

Marek Polacek - May 31, 2013, 10:50 a.m.
This adds a reduced testcase for PR57478.
Regtested on x86_64-linux.  Ok for trunk?

2013-05-31  Marek Polacek  <polacek@redhat.com>

	PR tree-optimization/57478
	PR tree-optimization/57453
	* gcc.dg/torture/pr57478.c: New test.


	Marek
Richard Guenther - May 31, 2013, 10:53 a.m.
On Fri, 31 May 2013, Marek Polacek wrote:

> This adds a reduced testcase for PR57478.
> Regtested on x86_64-linux.  Ok for trunk?

Ok.

Thanks,
Richard.

> 2013-05-31  Marek Polacek  <polacek@redhat.com>
> 
> 	PR tree-optimization/57478
> 	PR tree-optimization/57453
> 	* gcc.dg/torture/pr57478.c: New test.
> 
> --- gcc/testsuite/gcc.dg/torture/pr57478.c.mp2	2013-05-31 11:31:27.179683480 +0200
> +++ gcc/testsuite/gcc.dg/torture/pr57478.c	2013-05-31 11:31:50.239753729 +0200
> @@ -0,0 +1,21 @@
> +/* { dg-do compile } */
> +
> +typedef struct Node Node;
> +
> +struct Node
> +{
> +  Node *Pred, *Suc;
> +  Node *SubBestPred;
> +  Node *SubBestSuc;
> +};
> +
> +void
> +foo (Node *N)
> +{
> +  do
> +    {
> +      N->SubBestPred = N->Pred;
> +      N->SubBestSuc = N->Suc;
> +    }
> +  while (N = N->Suc);
> +}
> 
> 	Marek
> 
>

Patch

--- gcc/testsuite/gcc.dg/torture/pr57478.c.mp2	2013-05-31 11:31:27.179683480 +0200
+++ gcc/testsuite/gcc.dg/torture/pr57478.c	2013-05-31 11:31:50.239753729 +0200
@@ -0,0 +1,21 @@ 
+/* { dg-do compile } */
+
+typedef struct Node Node;
+
+struct Node
+{
+  Node *Pred, *Suc;
+  Node *SubBestPred;
+  Node *SubBestSuc;
+};
+
+void
+foo (Node *N)
+{
+  do
+    {
+      N->SubBestPred = N->Pred;
+      N->SubBestSuc = N->Suc;
+    }
+  while (N = N->Suc);
+}