public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ivan at cvut dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/36391] Compilation never ends
Date: Sun, 15 Jun 2008 16:12:00 -0000	[thread overview]
Message-ID: <20080615161153.31183.qmail@sourceware.org> (raw)
In-Reply-To: <bug-36391-16263@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from ivan at cvut dot cz  2008-06-15 16:11 -------
Final shortened code looks like this:
-------------- snap --------------
#include <boost/spirit.hpp>

void A()
{
  using namespace boost::spirit;

  rule<> char_tm= (
                     ch_p('=') | 
                     ';' |
                     ',' | 
                     '|' |
                     '*' | 
                     '.' | 
                     '(' | 
                     ')' | 
                     '<' | 
//                   '>' | 
//                   '%' | 
//                   blank_p |
                     eol_p 
                   );
};
-------------- snap --------------

Compilation time grows exponentially with number of | operators.
See table
No. of '|' operators     comp. time
01 - 0m1.768s
02 - 0m1.908s
03 - 0m2.072s
04 - 0m1.888s
05 - 0m2.088s
06 - 0m2.956s
07 - 0m5.188s
08 - 0m15.437s
09 - 0m54.819s
10 - 3m32.769s
11 - 14m5.553s
...
etc


-- 

ivan at cvut dot cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ivan at cvut dot cz


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36391


  parent reply	other threads:[~2008-06-15 16:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-30 14:06 [Bug c++/36391] New: " ivan at cvut dot cz
2008-05-30 14:10 ` [Bug c++/36391] " ivan at cvut dot cz
2008-06-05 14:36 ` ivan at cvut dot cz
2008-06-15 16:06 ` ivan at cvut dot cz
2008-06-15 16:12 ` ivan at cvut dot cz [this message]
2008-09-11  7:50 ` rhorstmann at securecomputing dot com
2008-10-21 21:26 ` manu at gcc dot gnu dot org
2008-10-22 16:59 ` pluto at agmk dot net
2008-10-22 17:07 ` manu at gcc dot gnu dot org
2008-10-23  7:58 ` ivan at vc dot cvut dot cz

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=20080615161153.31183.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).