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

             Bug #: 50390
           Summary: gcc hangs while compiling invalid c++ code
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: pipp...@exherbo.org


Created attachment 25266
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25266
likely hang delta-reduced from a preprocessor dump (that was valid code and did
not cause a hang)

I'm attaching a preprocessor dump of C++ code that appears to make g++ hang for
me.

This happens with g++ 4.4.6, 4.5.3, and 4.6.1.

This file (likely-hang6-bcpp.ii) is a delta reduction of the file
test-edges0-memGKN.ii.xz from bug #50388 (attachment 25263). The differences to
the file

  reduce-gcc-segfault/test-edges0-memGKN-segfault-bcpp.ii (attachment 25264)

which is also attached to bug #50388, are marginal.

g++ 4.6.1 hangs at this point:

% g++- -c likely-hang6-bcpp.ii 
likely-hang6-bcpp.ii:150:36: warning: variadic templates only available with
-std=c++0x or -std=gnu++0x [enabled by default]
likely-hang6-bcpp.ii:154:52: warning: variadic templates only available with
-std=c++0x or -std=gnu++0x [enabled by default]
likely-hang6-bcpp.ii:158:26: warning: variadic templates only available with
-std=c++0x or -std=gnu++0x [enabled by default]
likely-hang6-bcpp.ii:322:90: error: template instantiation depth exceeds
maximum of 1024 (use -ftemplate-depth= to increase the maximum) instantiating
‘class Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>,
4294966286u>’
likely-hang6-bcpp.ii:322:90:   recursively instantiated from
‘Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>, 1u>’
likely-hang6-bcpp.ii:322:90:   instantiated from
‘Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>, 2u>’
likely-hang6-bcpp.ii:325:70:   instantiated from
‘Dune::GenericGeometry::HybridMapping<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false> >’
likely-hang6-bcpp.ii:335:68:   instantiated from
‘Dune::GenericGeometry::VirtualMapping<Dune::GenericGeometry::Prism<Dune::GenericGeometry::Prism<Dune::GenericGeometry::Point>
>, Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false> >’
likely-hang6-bcpp.ii:345:60:   recursively instantiated from ‘const int
Dune::GenericGeometry::StaticMaximum<Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::MappingSize<1>, Dune::GenericForLoop<Dune::GenericGeometry::StaticMaximum,
Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::MappingSize, 2, 3> >::v’
likely-hang6-bcpp.ii:345:60:   instantiated from ‘const int
Dune::GenericGeometry::StaticMaximum<Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::MappingSize<0>, Dune::GenericForLoop<Dune::GenericGeometry::StaticMaximum,
Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::MappingSize, 1, 3> >::v’
likely-hang6-bcpp.ii:360:100:   instantiated from ‘const unsigned int
Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::maxMappingSize’
likely-hang6-bcpp.ii:396:80:   instantiated from ‘const unsigned int
Dune::GenericGeometry::MappingProvider<Dune::GenericGeometry::HybridMapping<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false> >,
0u>::maxMappingSize’
likely-hang6-bcpp.ii:423:67:   instantiated from
‘Dune::GenericGeometry::BasicGeometry<2,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false> >’
likely-hang6-bcpp.ii:426:76:   instantiated from ‘Dune::MockGeometry<double,
2ul, 2ul>’
likely-hang6-bcpp.ii:447:9:   instantiated from ‘TestGeometries<ctype,
2ul>::TestGeometries() [with ctype = double]’
likely-hang6-bcpp.ii:453:27:   instantiated from ‘void testEdgeS0_5(int&) [with
long unsigned int dim = 2ul]’
likely-hang6-bcpp.ii:462:31:   instantiated from here

likely-hang6-bcpp.ii:322:90: error: invalid use of incomplete type ‘class
Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>,
4294966286u>’
likely-hang6-bcpp.ii:322:90: error: declaration of ‘class
Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>,
4294966286u>’

Reply via email to