[Bug c/25491] New: gcc segfaults compiling very long expressions
I was writing a program that evaluates an operator tree with variables constants and operators. Rather than recursively iterate the tree many times for different variable values to evaluate it.. I printed the tree into a source file, compiled it as a shared library with gcc and dynamically linked it and call the function. In my case this is a much faster solution.. unless the tree is too big: $ /usr/bin/gcc -shared -o libevaleqn.so evaleqn.c evaleqn.c:2:9: warning: null character(s) ignored gcc: Internal error: Segmentation fault (program cc1) Please submit a full bug report. See http://bugs.gentoo.org/> for instructions. For smaller sizes it compiles fine. I'm guessing this is a limitation on the length of expressions supported by gcc. I tested this on x86_64 (gcc 3.4.4) and i686 (gcc 3.4.4 and 3.3.6) and the results are the same. -- Summary: gcc segfaults compiling very long expressions Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: geckosenator at gmail dot com GCC build triplet: i686-pc-linux GCC host triplet: i686-pc-linux GCC target triplet: i686-pc-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25491
[Bug c/25491] gcc segfaults compiling very long expressions
--- Comment #1 from geckosenator at gmail dot com 2005-12-19 02:27 --- Created an attachment (id=10531) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10531&action=view) bzip2 compressed file that produces gcc segfault -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25491
[Bug c/25491] gcc segfaults compiling very long expressions
--- Comment #3 from geckosenator at gmail dot com 2005-12-19 13:31 --- (In reply to comment #2) > Works with 4.1, needs 300MB ram and about 10s (-O0). > Same for 4.0.x. > Works for 3.4, too, with 178MB but takes a bit longer to compile. > > Are you sure you tried compiling without optimization? > I have tested it myself with gcc 4.0.2 and it worked. I'm now told this isn't a problem on gcc 4.x.. so I'm no longer sure if I should report it as a valid bug. I have had other people test this on gcc 3.x with both failure and success. I think it depends how gcc is installed. I was not using optimizations when I tested it. thanks -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25491