From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3135 invoked by alias); 6 Dec 2002 20:17:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3114 invoked by uid 61); 6 Dec 2002 20:17:03 -0000 Date: Fri, 06 Dec 2002 12:17:00 -0000 Message-ID: <20021206201703.3113.qmail@sources.redhat.com> To: derrick@caltech.edu, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, derrick@caltech.edu, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/8489: -ftemplate-depth and -O X-SW-Source: 2002-12/txt/msg00379.txt.bz2 List-Id: Old Synopsis: -ftemplate-depth and -O together reject legal code New Synopsis: -ftemplate-depth and -O State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Fri Dec 6 12:17:01 2002 State-Changed-Why: Confirmed. However, note that the code is not just rejected, by setting -ftemplate-depth-40 you lower the limit from 500, so you can expect that some codes will not compile. Nevertheless, there are two issues I see: 1. Switching on -O should not affect the template instantiation depth, so should not make a difference. However, it does. 2. The output is barely readable. To see this even more clearly, delete all the #line lines, from the testcase, using the following little perl line: perl -pi -e 's/^#.*\n//g;' *.ii and compiler with -O and -ftemplate-depth-40. What you get, is amazingly something like this: In file included from KonarBhattEig.ii:54027, from KonarBhattEig.ii:54008, from KonarBhattEig.ii:54027, from KonarBhattEig.ii:54008, from KonarBhattEig.ii:54027, from KonarBhattEig.ii:54008, from KonarBhattEig.ii:54027, from KonarBhattEig.ii:54008, from KonarBhattEig.ii:54027, [... many lines deleted ...] KonarBhattEig.ii: In constructor `blitz::_bz_BinaryClassExprOp2::_bz_BinaryClassExprOp2(const P_binaryOp&, const P_expr1&, const P_expr2&) [with P_expr1 = blitz::_bz_Expr >, blitz::_bz_FunctionObject > >, P_expr2 = blitz::_bz_Expr >, nr::Interpolation > >, P_binaryOp = NSConductivityBase]': KonarBhattEig.ii:54008: template instantiation depth exceeds maximum of 40 (use -ftemplate-depth-NN to increase the maximum) instantiating `std::ostream& operator<<(const _format_out_ostream
&, const T&) [with form = _mma_form_dummy, T = double]' KonarBhattEig.ii:54008: instantiated from `_format_out_ostream operator<<(std::ostream&, const _format_out&) [with form = _mma_form_dummy]' KonarBhattEig.ii:54027: instantiated from `std::ostream& operator<<(const _format_out_ostream&, const T&) [with form = _mma_form_dummy, T = double]' [... long list of template instantiations deleted ...] Note that since I deleted all #line lines from the input, the whole thing about "included from" cannot be right. And in fact is not: these are the lines where the template instantiations or declarations are, as far as I can see. This does not make much sense... W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8489