summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-22 20:42:58 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-22 20:42:58 +0000
commit569887b41c56f806a7c8316208f01b66120d45cc (patch)
tree48b8e3eb18a4828c52af140ab395186f2b5d21b9
parent9b7c4a900c4073cdbdcd4e4d2c3ae1e16bab463d (diff)
downloadgcc-569887b41c56f806a7c8316208f01b66120d45cc.tar.gz
2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/5050 * tree.c (cp_start_inlining): Remove. (cp_end_inlining): Remove. * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define. (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define. * cp-tree.h (cp_start_inlining): Do not declare. (cp_end_inlining): Do not declare. PR c++/5050 * g++.dg/template/recurse1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74947 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/cp-lang.c4
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/tree.c22
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/template/recurse1.C16
6 files changed, 30 insertions, 28 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 05b58a873df..defadd5d34f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,13 @@
+2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/5050
+ * tree.c (cp_start_inlining): Remove.
+ (cp_end_inlining): Remove.
+ * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define.
+ (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define.
+ * cp-tree.h (cp_start_inlining): Do not declare.
+ (cp_end_inlining): Do not declare.
+
2003-12-22 Mark Mitchell <mark@codesourcery.com>
PR c++/12479
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index fdb14048d47..d9959e031ed 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -156,10 +156,6 @@ static void cxx_initialize_diagnostics (diagnostic_context *);
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p
#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p
-#undef LANG_HOOKS_TREE_INLINING_START_INLINING
-#define LANG_HOOKS_TREE_INLINING_START_INLINING cp_start_inlining
-#undef LANG_HOOKS_TREE_INLINING_END_INLINING
-#define LANG_HOOKS_TREE_INLINING_END_INLINING cp_end_inlining
#undef LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS
#define LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS c_estimate_num_insns
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 5dbd102baa2..ba9770515d4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4169,8 +4169,6 @@ extern int cp_is_overload_p (tree);
extern int cp_auto_var_in_fn_p (tree,tree);
extern tree cp_copy_res_decl_for_inlining (tree, tree, tree, void*,
int*, tree);
-extern int cp_start_inlining (tree);
-extern void cp_end_inlining (tree);
/* in typeck.c */
extern int string_conv_p (tree, tree, int);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 74e73992e93..426c3d7c9ed 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2194,28 +2194,6 @@ cp_copy_res_decl_for_inlining (tree result,
return var;
}
-/* Record that we're about to start inlining FN, and return nonzero if
- that's OK. Used for lang_hooks.tree_inlining.start_inlining. */
-
-int
-cp_start_inlining (tree fn)
-{
- if (DECL_TEMPLATE_INSTANTIATION (fn))
- return push_tinst_level (fn);
- else
- return 1;
-}
-
-/* Record that we're done inlining FN. Used for
- lang_hooks.tree_inlining.end_inlining. */
-
-void
-cp_end_inlining (tree fn ATTRIBUTE_UNUSED )
-{
- if (DECL_TEMPLATE_INSTANTIATION (fn))
- pop_tinst_level ();
-}
-
/* Initialize tree.c. */
void
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5da002ebe17..640c307d2b7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * g++.dg/template/recurse1.C: New test
+
2003-12-22 Mark Mitchell <mark@codesourcery.com>
PR c++/12479
diff --git a/gcc/testsuite/g++.dg/template/recurse1.C b/gcc/testsuite/g++.dg/template/recurse1.C
new file mode 100644
index 00000000000..4789983affe
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/recurse1.C
@@ -0,0 +1,16 @@
+// PR c++/5050
+// Origin: georg.wild@gmx.de
+// Reduced by: tbagot@bluearc.com and Nathanael C. Nerode <neroden@twcny.rr.com>
+// Test for that excessive template recursion does not occur
+// because of optimization.
+// { dg-options "-ftemplate-depth-1 -O" }
+
+ struct ostream {
+ template<class T> ostream& foo( const T & )
+ { return *this; }
+ };
+
+ void foo() {
+ ostream os;
+ (os.foo(1)).foo(2);
+ }