Patchwork Add testcase for PR56398

login
register
mail settings
Submitter Marek Polacek
Date Feb. 21, 2013, 10:05 a.m.
Message ID <20130221100521.GA18098@redhat.com>
Download mbox | patch
Permalink /patch/222234/
State New
Headers show

Comments

Marek Polacek - Feb. 21, 2013, 10:05 a.m.
This adds a reduced testcase for PR56398.  Ok for trunk?

2013-02-21  Marek Polacek  <polacek@redhat.com>

	PR tree-optimization/56398
	* g++.dg/torture/pr56398.C: New test. 


	Marek
Richard Guenther - Feb. 21, 2013, 10:12 a.m.
On Thu, Feb 21, 2013 at 11:05 AM, Marek Polacek <polacek@redhat.com> wrote:
> This adds a reduced testcase for PR56398.  Ok for trunk?

Ok.

Thanks,
Richard.

> 2013-02-21  Marek Polacek  <polacek@redhat.com>
>
>         PR tree-optimization/56398
>         * g++.dg/torture/pr56398.C: New test.
>
> --- gcc/g++.dg/torture/pr56398.C.mp     2013-02-21 10:58:14.388913070 +0100
> +++ gcc/g++.dg/torture/pr56398.C        2013-02-21 10:58:53.301026474 +0100
> @@ -0,0 +1,22 @@
> +// { dg-do compile }
> +// { dg-options "-g" }
> +
> +namespace
> +{
> +#0 "/usr/include/c/4.8/bits/postypes.h" 3
> +}
> +
> +vtkpow (int b)
> +{
> +  int a1;
> +  int b1;
> +  int c;
> +  while (b1)
> +    {
> +      while (b)
> +    b1 = 0;
> +      b1 = b1 - 1;
> +      c = c * a1;
> +    }
> +  return c;
> +}
>
>         Marek

Patch

--- gcc/g++.dg/torture/pr56398.C.mp	2013-02-21 10:58:14.388913070 +0100
+++ gcc/g++.dg/torture/pr56398.C	2013-02-21 10:58:53.301026474 +0100
@@ -0,0 +1,22 @@ 
+// { dg-do compile }
+// { dg-options "-g" }
+
+namespace
+{
+#0 "/usr/include/c/4.8/bits/postypes.h" 3
+}
+
+vtkpow (int b)
+{
+  int a1;
+  int b1;
+  int c;
+  while (b1)
+    {
+      while (b)
+    b1 = 0;
+      b1 = b1 - 1;
+      c = c * a1;
+    }
+  return c;
+}