public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8489: -ftemplate-depth and -O
@ 2002-12-06 12:17 bangerth
  0 siblings, 0 replies; only message in thread
From: bangerth @ 2002-12-06 12:17 UTC (permalink / raw)
  To: derrick, gcc-bugs, gcc-prs, nobody

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<P_expr1, 
       P_expr2, P_binaryOp>::_bz_BinaryClassExprOp2(const P_binaryOp&, const 
       P_expr1&, const P_expr2&) [with P_expr1 = 
       blitz::_bz_Expr<blitz::_bz_UnaryClassExprOp<blitz::_bz_Expr<blitz::_bz_ExprIdentity<double>
       >, blitz::_bz_FunctionObject<double, NSStruct> > >, P_expr2 = 
       blitz::_bz_Expr<blitz::_bz_UnaryClassExprOp2<blitz::_bz_Expr<blitz::_bz_ExprIdentity<double>
       >, nr::Interpolation<double> > >, 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<form>&, const T&) [with form = 
       _mma_form_dummy, T = double]'
    KonarBhattEig.ii:54008:   instantiated from `_format_out_ostream<form> operator<<(std::ostream&, const _format_out<form>&) [with form = _mma_form_dummy]'
    KonarBhattEig.ii:54027:   instantiated from `std::ostream& operator<<(const _format_out_ostream<form>&, 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-06 20:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-06 12:17 c++/8489: -ftemplate-depth and -O bangerth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).