in this command: $ rx-elf-g++ -v Using built-in specs. COLLECT_GCC=rx-elf-gcc COLLECT_LTO_WRAPPER=/home/kikairoya/gcc/libexec/gcc/rx-elf/4.6.1/lto-wrapper Target: rx-elf Configured with: /home/kikairoya/repos/gcc/configure --target=rx-elf --prefix=/home/kikairoya/gcc --disable-nls --enable-target-optspace --with-newlib --enable-languages=c,c++ --without-ppl --enable-checking=release Thread model: single gcc version 4.6.2 (GCC) $ rx-elf-g++ -flto -std=c++0x -g -xc++ /dev/null -include functional In file included from /home/kikairoya/gcc/lib/gcc/rx-elf/4.6.2/../../../../rx-elf/include/c++/4.6.2/functional:59:0, from <command-line>:0: /home/kikairoya/gcc/lib/gcc/rx-elf/4.6.2/../../../../rx-elf/include/c++/4.6.2/bits/functional_hash.h: In instantiation of 'std::size_t std::hash<_Tp>::operator()(_Tp) const [with _Tp = long double, std::size_t = long unsigned int]': /home/kikairoya/gcc/lib/gcc/rx-elf/4.6.2/../../../../rx-elf/include/c++/4.6.2/functional:2267:1: instantiated from here /home/kikairoya/gcc/lib/gcc/rx-elf/4.6.2/../../../../rx-elf/include/c++/4.6.2/bits/functional_hash.h:184:5: internal compiler error: in write_builtin_type, at cp/mangle.c:2168 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. ICE occurs not only rx-elf but also sh-elf, m32c-elf, h8300-elf. No error in x86_64-linux-gnu. no problem if -fno-lto or -gstabs. This problem appears since r173860 (PR lto/48207).
GCC 4.6.3 is being released.
As I checked,this bug remained in the version 4.6.3
The fault also happens natively: cbuild@ursa2:~$ g++ -flto -std=c++0x -g -xc++ /dev/null -include functional In file included from /usr/include/c++/4.6/functional:59:0, from <command-line>:0: /usr/include/c++/4.6/bits/functional_hash.h: In instantiation of 'std::size_t std::hash<_Tp>::operator()(_Tp) const [with _Tp = long double, std::size_t = unsigned int]': /usr/include/c++/4.6/functional:2267:1: instantiated from here /usr/include/c++/4.6/bits/functional_hash.h:184:5: internal compiler error: in write_builtin_type, at cp/mangle.c:2168 cbuild@ursa2:~$ gcc --version gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 This isn't FSF 4.6.3 but is pretty close.
The 4.6 branch has been closed, does this problem exists also in 4.7.3 or later?
no problem at gcc-4.7.3. it works fine. $ rx-elf-g++ -v Using built-in specs. COLLECT_GCC=rx-elf-g++ COLLECT_LTO_WRAPPER=/home/kikairoya/rx/libexec/gcc/rx-elf/4.7.3/lto-wrapper Target: rx-elf Configured with: /home/kikairoya/sources/gcc-4.7.3/configure --prefix=/home/kikairoya/rx --target=rx-elf --disable-nls --enable-target-optspace --with-newlib --enable-languages=c,c++ --without-ppl --enable-checking=release Thread model: single gcc version 4.7.3 (GCC) $ rx-elf-g++ -flto -std=c++0x -g -xc++ /dev/null -include functional /home/kikairoya/rx/lib/gcc/rx-elf/4.7.3/../../../../rx-elf/lib/crt0.o: In function `L0': /home/kikairoya/sources/newlib-1.20.0/libgloss/rx/crt0.S:77: undefined reference to `_main' /home/kikairoya/rx/lib/gcc/rx-elf/4.7.3/../../../../rx-elf/bin/ld: /home/kikairoya/rx/lib/gcc/rx-elf/4.7.3/../../../../rx-elf/lib/crt0.o(P): error: call to undefined function '_main' collect2: error: ld returned 1 exit status
Fixed in 4.7.3 then.
*** Bug 49433 has been marked as a duplicate of this bug. ***