public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: bangerth@dealii.org
To: derrick@caltech.edu, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	nobody@gcc.gnu.org
Subject: Re: c++/8489: -ftemplate-depth and -O
Date: Fri, 06 Dec 2002 12:17:00 -0000	[thread overview]
Message-ID: <20021206201703.3113.qmail@sources.redhat.com> (raw)

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


                 reply	other threads:[~2002-12-06 20:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021206201703.3113.qmail@sources.redhat.com \
    --to=bangerth@dealii.org \
    --cc=derrick@caltech.edu \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).