This is the mail archive of the 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]

Re: [PATCH] Fix PR c++/5050: template instantiation depth exceeds/maybe recursion optimizing

On Dec 22, 2003, at 12:17, Jason Merrill wrote:

On Sun, 21 Dec 2003 17:18:13 -0800, Andrew Pinski <> wrote:

The problem here is caused by the patch which was to fix the testcase
In fact that testcase was fixed before as Phil's regression hunter shows:
Search converges between 2001-07-15-trunk (#28) and 2001-07-22-trunk (#29).

I have a lot of trouble believing that one of the C++ patches between those
dates could have fixed that bug. But I agree that the patch you cite was
wrong, and if it doesn't break recurse.C your patch is OK.

My patch does not break recurse.C at all. Here is the testcase I committed also:


// PR c++/5050
// Origin:
// Reduced by: and Nathanael C. Nerode <>
// 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;

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