summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-21 01:37:35 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-21 01:37:35 +0000
commit9cf1919403a5946b6cdead67f9db98049ba44aa6 (patch)
tree337ed6016df1dc1476a762f7d246d255cfed9a89 /gcc
parenta25fe002453525250274d62e00772cef35757703 (diff)
downloadppe42-gcc-9cf1919403a5946b6cdead67f9db98049ba44aa6.tar.gz
ppe42-gcc-9cf1919403a5946b6cdead67f9db98049ba44aa6.zip
PR middle-end/18683
* function.c (pop_function_context_from): Don't reset reg_renumber. * g++.dg/opt/pr18683-1.C: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92452 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/function.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/pr18683-1.C29
4 files changed, 39 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d5e223c5b32..5026be960a7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-20 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/18683
+ * function.c (pop_function_context_from): Don't reset reg_renumber.
+
2004-12-20 Eric Botcazou <ebotcazou@libertysurf.fr>
PR middle-end/18776
diff --git a/gcc/function.c b/gcc/function.c
index 9251071d6f8..a7dc2236bf6 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -286,7 +286,6 @@ pop_function_context_from (tree context ATTRIBUTE_UNUSED)
outer_function_chain = p->outer;
current_function_decl = p->decl;
- reg_renumber = 0;
lang_hooks.function.leave_nested (p);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d05d4ef1422..138785b2a89 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-20 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/18683
+ * g++.dg/opt/pr18683-1.C: New test case.
+
2004-12-20 Andrew Pinski <pinskia@physics.uc.edu>
PR other/19093
diff --git a/gcc/testsuite/g++.dg/opt/pr18683-1.C b/gcc/testsuite/g++.dg/opt/pr18683-1.C
new file mode 100644
index 00000000000..847a4d3c667
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr18683-1.C
@@ -0,0 +1,29 @@
+// PR middle-end/18683
+// { dg-do compile }
+// { dg-options "-O0" }
+
+template<typename _CharT>
+struct basic_ostream
+{
+ basic_ostream& operator<<(int __n);
+};
+
+extern basic_ostream<char> cout;
+
+template<int> struct linear_congruential
+{
+ template<class CharT>
+ friend basic_ostream<CharT>&
+ operator<<(basic_ostream<CharT>& os,
+ const linear_congruential& lcg)
+ {
+ return os << 1;
+ }
+};
+
+void instantiate_all()
+{
+ linear_congruential<0> lcf;
+ cout << lcf;
+}
+
OpenPOWER on IntegriCloud