This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Add a testcase for PR tree-optimization/35011


Hi,

PR tree-optimization/35011 was fixed by an unrelated patch before 4.4 was
branched. I am checking this into trunk and 4.4 branch.


H.J.
---
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 145408)
+++ ChangeLog	(working copy)
@@ -1,5 +1,10 @@
 2009-04-01  H.J. Lu  <hongjiu.lu@intel.com>
 
+	PR tree-optimization/35011
+	* g++.dg/other/pr35011.C: New.
+
+2009-04-01  H.J. Lu  <hongjiu.lu@intel.com>
+
 	PR c++/35240
 	* g++.dg/template/pr35240.C: New.
 
Index: g++.dg/other/pr35011.C
===================================================================
--- g++.dg/other/pr35011.C	(revision 0)
+++ g++.dg/other/pr35011.C	(revision 0)
@@ -0,0 +1,26 @@
+// { dg-do compile }
+// { dg-options "-O3 -fcheck-data-deps" }
+
+double foo(const double* p0, const double* p1, const double* q0)
+{
+  double d;
+  for (; p0 != p1; ++p0, ++q0)
+    d += *p0 * *q0;
+  return d;
+}
+
+struct A
+{
+  double x[3];
+  const double* begin() const { return x; }
+};
+
+struct B
+{
+  A a0, a1;
+  double d;
+  B(const A&);
+};
+
+B::B(const A& a) : a0(a), a1(a), d(foo(a0.begin(), a0.begin()+3, a1.begin()))
+{}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]