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

           Summary: ICE on legal code (when attempting to inline
                    non-implicitly instantiated template member function)
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: niema...@isg.de


Created attachment 23540
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23540
preprocessed and gzipped legal C++ code causing ICE with gcc 4.5.[0-2]

When compiling the attached "crash.ii" file using gcc 4.5.[012] with

> gcc -O3 -fno-implicit-templates -c crash.ii -o crash.o

gcc crashes with a segmentation fault:

> crashtest.cxx: In static member function 'static bool 
> LKV::MatchEntity::init_text_2_3(const LKV::Str&, LKV::Str&, LKV::Str&, 
> LKV::Array<long unsigned int, true, LKV::_T<LKV::AbsPtr>, long unsigned 
> int>*, LKV::Array<long unsigned int, true, LKV::_T<LKV::AbsPtr>, long 
> unsigned int>*)':
crashtest.cxx:130:3:
> 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.


The same code is compiled fine by gcc 4.4.*, it also compiles fine with
-O[0-2].

Notice that this code is part of a library that uses explicit template
instantiations, intriguingly when compiling with "-fimplicit-templates", gcc
4.5.* does not crash - which let's me wonder how "just doing less" can actually
trigger such a bug :-)

Reply via email to