Hi,

I ran into a ICE (segmentation fault) with GCC 4.5 (20091126) when building
some C++ templated code. The platform is GNU/Linux, x86-64.

Please find attached the preprocessed source:

   product_small.ii.bz2

I have compressed it because it was really huge (this codes uses a C++ template
library).

Below is the compiler output for the g++ that generated that .ii file. Scroll
to the end to see the ICE.


##### 22:58:34 ~/build/eigen/test$ /usr/bin/g++-4.5 -v -save-temps -DHAS_GSL
-DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NO_DEBUG -Wnon-virtual-dtor
-Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W
-Wpointer-arith -Wwrite-strings -Wformat-security -fexceptions -fno-check-new
-fno-common -fstrict-aliasing -Wextra -pedantic  -g2 -g0 -O2 
-fno-inline-functions -I/home/bjacob/build/eigen/test -I/home/bjacob/eigen/test
-I/home/bjacob/eigen -I/home/bjacob/build/eigen -I/usr/include/QtGui
-I/usr/include/QtCore    -DEIGEN_TEST_FUNC=product_small  -DEIGEN_TEST_PART_1=1
-o CMakeFiles/test_product_small_1.dir/product_small.cpp.o -c
/home/bjacob/eigen/test/product_small.cpp                                       
Using built-in specs.                                                           
COLLECT_GCC=/usr/bin/g++-4.5                                                    
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper     
Target: x86_64-unknown-linux-gnu                                                
Configured with: ../configure --prefix=/usr --enable-languages=c,c++
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-lto --enable-gnu-unique-object --disable-multilib
--disable-libstdcxx-pch --with-tune=generic --with-system-zlib --with-ppl
--with-cloog --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --disable-werror --enable-checking=release
--program-suffix=-4.5 --enable-version-specific-runtime-libs  
Thread model: posix                                                             
gcc version 4.5.0 20091126 (experimental) (GCC)                                 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-DHAS_GSL' '-DQT_DLL' '-DQT_GUI_LIB'
'-DQT_CORE_LIB' '-DQT_NO_DEBUG' '-Wnon-virtual-dtor' '-Wno-long-long' '-ansi'
'-Wundef' '-Wcast-align' '-Wchar-subscripts' '-Wall' '-W' '-Wpointer-arith'
'-Wwrite-strings' '-Wformat-security' '-fexceptions' '-fno-check-new'
'-fno-common' '-fstrict-aliasing' '-Wextra' '-pedantic' '-g2' '-g0' '-O2'
'-fno-inline-functions' '-I/home/bjacob/build/eigen/test'
'-I/home/bjacob/eigen/test' '-I/home/bjacob/eigen' '-I/home/bjacob/build/eigen'
'-I/usr/include/QtGui' '-I/usr/include/QtCore'
'-DEIGEN_TEST_FUNC=product_small' '-DEIGEN_TEST_PART_1=1' '-o'
'CMakeFiles/test_product_small_1.dir/product_small.cpp.o' '-c' '-shared-libgcc'
'-mtune=generic'                   
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus -E -quiet -v
-I/home/bjacob/build/eigen/test -I/home/bjacob/eigen/test -I/home/bjacob/eigen
-I/home/bjacob/build/eigen -I/usr/include/QtGui -I/usr/include/QtCore
-D_GNU_SOURCE -DHAS_GSL -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NO_DEBUG
-DEIGEN_TEST_FUNC=product_small -DEIGEN_TEST_PART_1=1
/home/bjacob/eigen/test/product_small.cpp -mtune=generic -ansi
-Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall
-W -Wpointer-arith -Wwrite-strings -Wformat-security -Wextra -pedantic
-fexceptions -fno-check-new -fno-common -fstrict-aliasing -fno-inline-functions
-O2 -fpch-preprocess -o product_small.ii                                        
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/include"
 
#include "..." search starts here:                                              
#include <...> search starts here:                                              
 /home/bjacob/build/eigen/test                                                  
 /home/bjacob/eigen/test                                                        
 /home/bjacob/eigen                                                             
 /home/bjacob/build/eigen                                                       
 /usr/include/QtGui                                                             
 /usr/include/QtCore                                                            
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include/c++                        

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include/c++/x86_64-unknown-linux-gnu
 
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include/c++/backward               
 /usr/local/include                                                             
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include                            
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include-fixed                      
 /usr/include                                                                   
End of search list.                                                             
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-DHAS_GSL' '-DQT_DLL' '-DQT_GUI_LIB'
'-DQT_CORE_LIB' '-DQT_NO_DEBUG' '-Wnon-virtual-dtor' '-Wno-long-long' '-ansi'
'-Wundef' '-Wcast-align' '-Wchar-subscripts' '-Wall' '-W' '-Wpointer-arith'
'-Wwrite-strings' '-Wformat-security' '-fexceptions' '-fno-check-new'
'-fno-common' '-fstrict-aliasing' '-Wextra' '-pedantic' '-g2' '-g0' '-O2'
'-fno-inline-functions' '-I/home/bjacob/build/eigen/test'
'-I/home/bjacob/eigen/test' '-I/home/bjacob/eigen' '-I/home/bjacob/build/eigen'
'-I/usr/include/QtGui' '-I/usr/include/QtCore'
'-DEIGEN_TEST_FUNC=product_small' '-DEIGEN_TEST_PART_1=1' '-o'
'CMakeFiles/test_product_small_1.dir/product_small.cpp.o' '-c' '-shared-libgcc'
'-mtune=generic'
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus -fpreprocessed
product_small.ii -quiet -dumpbase product_small.cpp -mtune=generic -ansi
-auxbase-strip CMakeFiles/test_product_small_1.dir/product_small.cpp.o -g2 -g0
-O2 -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts
-Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wextra -pedantic
-ansi -version -fexceptions -fno-check-new -fno-common -fstrict-aliasing
-fno-inline-functions -o product_small.s
GNU C++ (GCC) version 4.5.0 20091126 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.5.0 20091126 (experimental), GMP version
4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.5.0 20091126 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.5.0 20091126 (experimental), GMP version
4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: b74b35577b24604a564e27e0e25efd13
In file included from /home/bjacob/eigen/test/product_small.cpp:26:0:
/home/bjacob/eigen/test/product.h: In function ‘void product(const MatrixType&)
[with MatrixType = Eigen::Matrix<float, 3, 2, 0>]’:
/home/bjacob/eigen/test/product_small.cpp:31:97:   instantiated from here
/home/bjacob/eigen/test/product.h:45:60: internal compiler error: Segmentation
fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: GCC 4.5 ICE (segfault) on C++ templated code
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jacob dot benoit dot 1 at gmail dot com


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

Reply via email to