re PR debug/52727 (internal compiler error at dwarf2cfi.c2:685)
authorRichard Henderson <rth@redhat.com>
Fri, 30 Mar 2012 18:23:06 +0000 (11:23 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 30 Mar 2012 18:23:06 +0000 (11:23 -0700)
PR debug/52727
* g++.dg/opt/pr52727.C: New testcase.

From-SVN: r186019

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr52727.C [new file with mode: 0644]

index 549789d..921f2fa 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-30  Richard Henderson <rth@redhat.com>
+
+       PR debug/52727
+       * g++.dg/opt/pr52727.C: New testcase.
+
 2012-03-30  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/52754
diff --git a/gcc/testsuite/g++.dg/opt/pr52727.C b/gcc/testsuite/g++.dg/opt/pr52727.C
new file mode 100644 (file)
index 0000000..4dd3853
--- /dev/null
@@ -0,0 +1,45 @@
+// { dg-do compile }
+// { dg-options "-g -Os" }
+
+int grow (int);
+void fn (int);
+struct A { int a1, a2; };
+template <typename T>
+struct B
+{
+  A *b;
+  ~B () { b3 (b); }
+  void b1 (int);
+  void b2 (int);
+  void b3 (A *);
+};
+struct C { int c1, c2, c3; bool c4; };
+int
+bar (int x)
+{
+  int y = x / 6;
+  if (y > x / 2)
+    return y;
+  return 0;
+}
+void baz (double, double);
+void
+foo (const C *x, int y, int z)
+{
+  B<int> p;
+  double r = y / 2;
+  int w = bar (int (r));
+  double s = y / 2 + 0.5;
+  double t = z / 2 + 0.5;
+  int u = x->c3;
+  int v = (x->c2 + u - 1 - x->c1) / u;
+  p.b2 ((2 * v > p.b->a1 || (2 * v < p.b->a2 && 2 * v < (p.b->a1 >> 1)))
+        ? grow (0) : p.b->a1);
+  for (int i = 0; i <= v; ++i)
+    {
+      double l = x->c4 ? 4.5 - i * 6.2 / v : (3.1 - i * 31 / v) / 6;
+      baz (s + (r - w) * l, t - (r - w) * l);
+    }
+}
+
+