This is the mail archive of the gcc-prs@gcc.gnu.org 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: c++/8489: -ftemplate-depth and -O


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


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