public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/36391]  New: Compilation never ends
@ 2008-05-30 14:06 ivan at cvut dot cz
  2008-05-30 14:10 ` [Bug c++/36391] " ivan at cvut dot cz
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ivan at cvut dot cz @ 2008-05-30 14:06 UTC (permalink / raw)
  To: gcc-bugs

When compiling my code compilation never ends(takes more than 2 hours).
Same source can be compiled on 32bit linux without any problems.

Platforms known to work:
Gentoo linux
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --disable-libunwind-exceptions
--disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2)

Platforms, where compilation failts:
Centos5:
[root@centosa src]# g++ -v -save-temps  trotl_parser.i 
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)
 /usr/libexec/gcc/x86_64-redhat-linux/4.1.2/cc1plus -fpreprocessed
trotl_parser.i -quiet -dumpbase trotl_parser.i -mtune=generic -auxbase
trotl_parser -version -o trotl_parser.s
GNU C++ version 4.1.2 20070626 (Red Hat 4.1.2-14) (x86_64-redhat-linux)
        compiled by GNU C version 4.1.2 20070626 (Red Hat 4.1.2-14).
GGC heuristics: --param ggc-min-expand=55 --param ggc-min-heapsize=47694
Compiler executable checksum: 1b5a07286c4ca6738c6243b887a3a164

Ubuntu 8.04:
ivan@brezina:~/devel/trotl/objdir-424/src$ g++ -v -save-temps  trotl_parser.i 
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
 /usr/lib/gcc/x86_64-linux-gnu/4.2.3/cc1plus -fpreprocessed trotl_parser.i
-quiet -dumpbase trotl_parser.i -mtune=generic -auxbase trotl_parser -version
-fstack-protector -fstack-protector -o trotl_parser.s
GNU C++ version 4.2.3 (Ubuntu 4.2.3-2ubuntu7) (x86_64-linux-gnu)
        compiled by GNU C version 4.2.3 (Ubuntu 4.2.3-2ubuntu7).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d12ba6ac5ad10f3cd3c194fd1127d2d9

Ubuntu 8.04 with gcc-4.2.4 compiled from source:
ivan@brezina:~/devel/trotl/objdir-424/src$ ~/gcc-424/bin/g++ -v -save-temps 
trotl_parser.i 
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/home/ivan/gcc-424
--enable-languages=c,c++
Thread model: posix
gcc version 4.2.4
 /home/ivan/gcc-424/libexec/gcc/x86_64-unknown-linux-gnu/4.2.4/cc1plus
-fpreprocessed trotl_parser.i -quiet -dumpbase trotl_parser.i -mtune=generic
-auxbase trotl_parser -version -o trotl_parser.s
GNU C++ version 4.2.4 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.2.4.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 4b83ed1fc6649caf958073e436edbdba


-- 
           Summary: Compilation never ends
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ivan at cvut dot cz
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends ivan at cvut dot cz
@ 2008-05-30 14:10 ` ivan at cvut dot cz
  2008-06-05 14:36 ` ivan at cvut dot cz
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ivan at cvut dot cz @ 2008-05-30 14:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ivan at cvut dot cz  2008-05-30 14:09 -------
Created an attachment (id=15704)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15704&action=view)
This source fails to compile

This source uses boost::spirit parser generator. Uses a lot of template
specializations and operator overrides.


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends 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
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ivan at cvut dot cz @ 2008-06-05 14:36 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2819 bytes --]



------- Comment #2 from ivan at cvut dot cz  2008-06-05 14:35 -------
This bug is related to x86_64 target. When generating 32bit .o file,
compilations succeds even with 64bit version of g++.
See:

ivan@brezina:/tmp$ g++ -m32 trotl_parser.i 
In file included from /usr/include/c++/4.2/ext/new_allocator.h:38,
                 from
/usr/include/c++/4.2/x86_64-linux-gnu/bits/c++allocator.h:40,
                 from /usr/include/c++/4.2/bits/allocator.h:54,
                 from /usr/include/c++/4.2/memory:55,
                 from /usr/include/c++/4.2/string:49,
                 from ../../src/trotl_parser.h:38,
                 from ../../src/trotl_parser.cpp:35:
/usr/include/c++/4.2/new:95: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:96: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:99: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:100: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:105: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:106: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
ivan@brezina:/tmp$ 
ivan@brezina:/tmp$ time g++ -m32 trotl_parser.i 
In file included from /usr/include/c++/4.2/ext/new_allocator.h:38,
                 from
/usr/include/c++/4.2/x86_64-linux-gnu/bits/c++allocator.h:40,
                 from /usr/include/c++/4.2/bits/allocator.h:54,
                 from /usr/include/c++/4.2/memory:55,
                 from /usr/include/c++/4.2/string:49,
                 from ../../src/trotl_parser.h:38,
                 from ../../src/trotl_parser.cpp:35:
/usr/include/c++/4.2/new:95: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:96: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:99: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:100: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:105: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter
/usr/include/c++/4.2/new:106: error: ‘operator new’ takes type ‘size_t’
(‘unsigned int’) as first parameter

real                          0m2.807s
user                          0m2.588s
sys                           0m0.212s
ivan@brezina:/tmp$ time g++ -m64 trotl_parser.i 
Terminated

real    81m2.005s
user    0m0.000s
sys     0m0.004s


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends 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
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ivan at cvut dot cz @ 2008-06-15 16:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ivan at cvut dot cz  2008-06-15 16:05 -------
Created an attachment (id=15773)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15773&action=view)
Shortened version

This is shortened version. - 70000 lines only :(


-- 

ivan at cvut dot cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15704|0                           |1
        is obsolete|                            |


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends ivan at cvut dot cz
                   ` (2 preceding siblings ...)
  2008-06-15 16:06 ` ivan at cvut dot cz
@ 2008-06-15 16:12 ` ivan at cvut dot cz
  2008-09-11  7:50 ` rhorstmann at securecomputing dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ivan at cvut dot cz @ 2008-06-15 16:12 UTC (permalink / raw)
  To: gcc-bugs



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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends ivan at cvut dot cz
                   ` (3 preceding siblings ...)
  2008-06-15 16:12 ` ivan at cvut dot cz
@ 2008-09-11  7:50 ` rhorstmann at securecomputing dot com
  2008-10-21 21:26 ` manu at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rhorstmann at securecomputing dot com @ 2008-09-11  7:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rhorstmann at securecomputing dot com  2008-09-11 07:49 -------
I think this is the same as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29512

So should be fixed in 4.3.


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends ivan at cvut dot cz
                   ` (4 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-10-21 21:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from manu at gcc dot gnu dot org  2008-10-21 21:25 -------
I cannot compile this testcase with GCC 4.3.2 or a recent revision of GCC 4.4. 

Could you recreate the prepocessed source with those compilers?


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends ivan at cvut dot cz
                   ` (5 preceding siblings ...)
  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
  8 siblings, 0 replies; 10+ messages in thread
From: pluto at agmk dot net @ 2008-10-22 16:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pluto at agmk dot net  2008-10-22 16:58 -------
(In reply to comment #6)
> I cannot compile this testcase with GCC 4.3.2 or a recent revision of GCC 4.4. 
> 
> Could you recreate the prepocessed source with those compilers?
> 

testcase compiles on recent 4.3 with -m{32,64} -O{0..3} w/ boost-1.36.0.
it needs ~1second/~120MB on my quad core box.


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends ivan at cvut dot cz
                   ` (6 preceding siblings ...)
  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
  8 siblings, 0 replies; 10+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-10-22 17:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from manu at gcc dot gnu dot org  2008-10-22 17:05 -------
(In reply to comment #7)
> 
> testcase compiles on recent 4.3 with -m{32,64} -O{0..3} w/ boost-1.36.0.
> it needs ~1second/~120MB on my quad core box.
> 

Thanks Pawel! If you could test also a recent GCC 4.4 that would be perfect.
Anyway, this seems FIXED. Please reopen if you can reproduce the problem with a
recent GCC release (or trunk).


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/36391] Compilation never ends
  2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends ivan at cvut dot cz
                   ` (7 preceding siblings ...)
  2008-10-22 17:07 ` manu at gcc dot gnu dot org
@ 2008-10-23  7:58 ` ivan at vc dot cvut dot cz
  8 siblings, 0 replies; 10+ messages in thread
From: ivan at vc dot cvut dot cz @ 2008-10-23  7:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ivan at vc dot cvut dot cz  2008-10-23 07:57 -------
Subject: Re:  Compilation never ends

Quoting manu at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org>:

>
>
> ------- Comment #6 from manu at gcc dot gnu dot org  2008-10-21 21:25 -------
> I cannot compile this testcase with GCC 4.3.2 or a recent revision   
> of GCC 4.4.
>
> Could you recreate the prepocessed source with those compilers?
>
>

I can can confirm, that GCC 4.3.2 compiles that source succefully
and very fast. There seem to be some problem with boost library.
A newer version of boost is needed to produce preprocessed source.
Can can create it if you want.

Ivan

> --
>
> manu at gcc dot gnu dot org changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |WAITING
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36391
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
> You reported the bug, or are watching the reporter.
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-10-23  7:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-30 14:06 [Bug c++/36391] New: Compilation never ends 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
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

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