This is the mail archive of the gcc-bugs@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]

[Bug c++/36391] Compilation never ends



------- 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


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