summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-08 17:17:52 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-08 17:17:52 +0000
commitb437daf41754afff274e689c4eddeb291a0e679e (patch)
tree7dfa5d5d22a7a192d98aea40e41add3c292cc255 /gcc/testsuite/g++.dg
parent7302546d02e4127d26720b6cf8c1ccf5a4216971 (diff)
downloadgcc-b437daf41754afff274e689c4eddeb291a0e679e.tar.gz
PR middle-end/40102
* cgraph.c (cgraph_create_edge_including_clones): Also asume that the original node might've been modified. * tree-inline.c (copy_bb): Do not assume that all clones are the same. PR middle-end/40102 * g++.dg/torture/pr40102.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r--gcc/testsuite/g++.dg/torture/pr40102.C41
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr40102.C b/gcc/testsuite/g++.dg/torture/pr40102.C
new file mode 100644
index 00000000000..49f56b5bc5a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr40102.C
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+bool foo0(int) { return true; }
+
+bool foo1();
+
+struct A
+{
+ A();
+ ~A();
+
+ template<typename T> void bar1(T f)
+ {
+ if (f(0))
+ foo1();
+ }
+
+ template<typename T> void bar2(T);
+};
+
+template<typename T> void A::bar2(T f)
+{
+ A a, b[1], *p;
+
+ while (foo1())
+ {
+ if (p)
+ ++p;
+ if (p && foo1())
+ bar1(f);
+ if (p)
+ ++p;
+ }
+
+ if (foo1())
+ bar1(f);
+}
+
+void baz()
+{
+ A().bar2(foo0);
+}