aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-01-03 11:28:30 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-01-03 11:28:30 +0100
commitcac67c0835c7cf87ca6bb62b5fab0a781ac006b4 (patch)
treea4d9a31ad1849aee61b7768db215e00ac788037e
parente0658eda3cfe217aa1cf8548642ef99490ef0b27 (diff)
downloadgcc-cac67c0835c7cf87ca6bb62b5fab0a781ac006b4.zip
gcc-cac67c0835c7cf87ca6bb62b5fab0a781ac006b4.tar.gz
gcc-cac67c0835c7cf87ca6bb62b5fab0a781ac006b4.tar.bz2
re PR c++/34619 (ICE with "-fmudflap" and templates)
PR c++/34619 * cgraphunit.c (cgraph_build_static_cdtor): set_cfun back to NULL before returning. * testsuite/libmudflap.c++/pass61-frag.cxx: New test. From-SVN: r131302
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cgraphunit.c4
-rw-r--r--libmudflap/ChangeLog5
-rw-r--r--libmudflap/testsuite/libmudflap.c++/pass61-frag.cxx20
4 files changed, 32 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e7098d0..952d851 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2008-01-03 Jakub Jelinek <jakub@redhat.com>
+ PR c++/34619
+ * cgraphunit.c (cgraph_build_static_cdtor): set_cfun back to NULL
+ before returning.
+
PR tree-optimization/29484
* tree-inline.c (inline_forbidden_p_2): New function.
(inline_forbidden_p): Disallow inlining if some static var
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 7215f1a..5d81f56 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1,5 +1,6 @@
/* Callgraph based interprocedural optimizations.
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Jan Hubicka
This file is part of GCC.
@@ -1515,6 +1516,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority)
cgraph_add_new_function (decl, false);
cgraph_mark_needed_node (cgraph_node (decl));
+ set_cfun (NULL);
}
void
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index 081f14c..1c7313a 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/34619
+ * testsuite/libmudflap.c++/pass61-frag.cxx: New test.
+
2008-01-01 Volker Reichelt <v.reichelt@netcologne.de>
PR libmudflap/26442
diff --git a/libmudflap/testsuite/libmudflap.c++/pass61-frag.cxx b/libmudflap/testsuite/libmudflap.c++/pass61-frag.cxx
new file mode 100644
index 0000000..0304611
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c++/pass61-frag.cxx
@@ -0,0 +1,20 @@
+// PR c++/34619
+// { dg-do compile }
+
+template <typename> struct A
+{
+ typedef int X;
+ static const int N = 1;
+};
+
+template <typename T> struct B
+{
+ typedef typename A <int [A <T>::N]>::X Y;
+ template <typename U> B (Y, U) {}
+};
+
+int main ()
+{
+}
+
+B <int>b (0, 0);