seen with trunk 20100112: $ g++ -c ../DemonsRegistration.ii In file included from /scratch/packages/tmp/rebuild/slicer-3.4.0~svn10438/Applications/CLI/DiffeomorphicDemonsRegistration/itkGridForwardWarpImageFilter.h:120:0, from /scratch/packages/tmp/rebuild/slicer-3.4.0~svn10438/Applications/CLI/DiffeomorphicDemonsRegistration/DemonsRegistration.cxx:48: /scratch/packages/tmp/rebuild/slicer-3.4.0~svn10438/Applications/CLI/DiffeomorphicDemonsRegistration/itkGridForwardWarpImageFilter.txx: In constructor 'itk::GridForwardWarpImageFilter<TDeformationField, TOutputImage>::GridForwardWarpImageFilter() [with TDeformationField = itk::Image<itk::Vector<float>, 3u>, TOutputImage = itk::Image<unsigned char, 3u>]': /scratch/packages/tmp/rebuild/slicer-3.4.0~svn10438/Applications/CLI/DiffeomorphicDemonsRegistration/itkGridForwardWarpImageFilter.h:49:125: instantiated from 'static itk::GridForwardWarpImageFilter<TDeformationField, TOutputImage>::Pointer itk::GridForwardWarpImageFilter<TDeformationField, TOutputImage>::New() [with TDeformationField = itk::Image<itk::Vector<float>, 3u>, TOutputImage = itk::Image<unsigned char, 3u>, itk::GridForwardWarpImageFilter<TDeformationField, TOutputImage>::Pointer = itk::SmartPointer<itk::GridForwardWarpImageFilter<itk::Image<itk::Vector<float>, 3u>, itk::Image<unsigned char, 3u> > >]' /scratch/packages/tmp/rebuild/slicer-3.4.0~svn10438/Applications/CLI/DiffeomorphicDemonsRegistration/DemonsRegistration.cxx:871:85: instantiated from 'void<unnamed>::DoDemonsRegistration(<unnamed>::arguments) [with unsigned int Dimension = 3u]' /scratch/packages/tmp/rebuild/slicer-3.4.0~svn10438/Applications/CLI/DiffeomorphicDemonsRegistration/DemonsRegistration.cxx:1018:35: instantiated from here /scratch/packages/tmp/rebuild/slicer-3.4.0~svn10438/Applications/CLI/DiffeomorphicDemonsRegistration/itkGridForwardWarpImageFilter.txx:23:3: internal compiler error: Segmentation fault Please submit a full bug report, Program received signal SIGSEGV, Segmentation fault. 0x00000000004d040b in tsubst (t=0x7fffee844bd0, args=0x7fffea07e210, complain=3, in_decl=0x7fffee347ac8) at ../../src/gcc/cp/pt.c:9870 9870 if (arg && TREE_CODE (arg) == ARGUMENT_PACK_SELECT) (gdb) p arg $1 = (tree) 0x3 (gdb) bt #0 0x00000000004d040b in tsubst (t=0x7fffee844bd0, args=0x7fffea07e210, complain=3, in_decl=0x7fffee347ac8) at ../../src/gcc/cp/pt.c:9870 #1 0x00000000004d3fdb in tsubst_template_args (t=<value optimized out>, args=<value optimized out>, complain=<value optimized out>, in_decl=<value optimized out>) at ../../src/gcc/cp/pt.c:8377 #2 0x00000000004d0de1 in tsubst (t=0x7fffee84de70, args=0x7fffea07e210, complain=3, in_decl=0x7fffee347ac8) at ../../src/gcc/cp/pt.c:9732 #3 0x00000000004d046f in tsubst (t=0x7fffee84f498, args=0x7fffea07e210, complain=3, in_decl=0x7fffee347ac8) at ../../src/gcc/cp/pt.c:10265 #4 0x00000000004d3fdb in tsubst_template_args (t=<value optimized out>, args=<value optimized out>, complain=<value optimized out>, in_decl=<value optimized out>) at ../../src/gcc/cp/pt.c:8377 #5 0x00000000004dab8b in tsubst_aggr_type (t=0x7fffee8bd888, args=0x7fffea07e210, complain=3, in_decl=0x7fffee347ac8, entering_scope=0) at ../../src/gcc/cp/pt.c:8543 #6 0x00000000004d4373 in tsubst_qualified_id (qualified_id=0x7fffee37ba80, args=0x7fffea07e210, complain=3, in_decl=<value optimized out>, done=<value optimized out>, address_p=<value optimized out>) at ../../src/gcc/cp/pt.c:10550 #7 0x00000000004d2241 in tsubst_copy_and_build (t=0x7fffee37ba80, args=0x7fffea07e210, complain=3, in_decl=0x7fffee347ac8, function_p=0 '\000', integral_constant_expression_p=0 '\000') at ../../src/gcc/cp/pt.c:12001 #8 0x00000000004d234e in tsubst_copy_and_build (t=0x7fffee390040, args=0x7fffea07e210, complain=3, in_decl=0x7fffee347ac8, function_p=0 '\000', integral_constant_expression_p=<value optimized out>) at ../../src/gcc/cp/pt.c:12045 #9 0x00000000004cd891 in tsubst_expr (t=0x7fffee390040, args=<value optimized out>, complain=3, in_decl=0x7fffee347ac8, integral_constant_expression_p=<value optimized out>) at ../../src/gcc/cp/pt.c:11747 #10 0x00000000004ce2b2 in tsubst_expr (t=0x7fffee38c930, args=<value optimized out>, complain=3, in_decl=0x7fffee347ac8, integral_constant_expression_p=<value optimized out>) at ../../src/gcc/cp/pt.c:11346 #11 0x00000000004ce215 in tsubst_expr (t=<value optimized out>, args=<value optimized out>, complain=3, in_decl=0x7fffee347ac8, integral_constant_expression_p=<value optimized out>) at ../../src/gcc/cp/pt.c:11332 #12 0x00000000004cd904 in tsubst_expr (t=0x7fffee37cac0, args=<value optimized out>, complain=3, in_decl=0x7fffee347ac8, integral_constant_expression_p=<value optimized out>) at ../../src/gcc/cp/pt.c:11488 #13 0x00000000004ce215 in tsubst_expr (t=<value optimized out>, args=<value optimized out>, complain=3, in_decl=0x7fffee347ac8, integral_constant_expression_p=<value optimized out>) at ../../src/gcc/cp/pt.c:11332 #14 0x00000000004cd904 in tsubst_expr (t=0x7fffee528f40, args=<value optimized out>, complain=3, in_decl=0x7fffee347ac8, integral_constant_expression_p=<value optimized out>) at ../../src/gcc/cp/pt.c:11488 #15 0x00000000004dbe0f in instantiate_decl (d=<value optimized out>, defer_ok=<value optimized out>, expl_inst_class_mem_p=<value optimized out>) at ../../src/gcc/cp/pt.c:16640 #16 0x00000000004df064 in instantiate_pending_templates (retries=<value optimized out>) at ../../src/gcc/cp/pt.c:16737 #17 0x00000000004f2d15 in cp_write_global_declarations () at ../../src/gcc/cp/decl2.c:3511 #18 0x000000000079f3a6 in compile_file (argc=12, argv=0x7fffffffe5f8) at ../../src/gcc/toplev.c:1065 #19 do_compile (argc=12, argv=0x7fffffffe5f8) at ../../src/gcc/toplev.c:2405 #20 toplev_main (argc=12, argv=0x7fffffffe5f8) at ../../src/gcc/toplev.c:2447 #21 0x00007ffff616cabd in __libc_start_main () from /lib/libc.so.6 #22 0x000000000049f179 in _start ()
Created attachment 19562 [details] preprocessed source
It is caused by revision 145440: http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg00060.html
Here is a smaller reproducer: template<class T> struct S { }; template<class T> struct S0 { typedef T TT; }; template<class U, class V> struct super_struct : S0<V> { typedef S0<V> super; }; template<class U, class V, class W> struct S1 : super_struct<U, V> { typedef super_struct<U, V> super; typedef typename super::super Super2; typedef typename Super2::TT Super2TT; void foo() { S<Super2TT> s1; } }; template<class U, class V> struct S2 : super_struct<U, V> { typedef super_struct<U, V> super; typedef typename super::super Super2; typedef typename Super2::TT Super2TT; void foo() { S<Super2TT> s1; } }; int main() { S1<int, S<int>, int> s1; s1.foo(); S2<int, S<int> > s2; s2.foo(); }
Candidate patch posted to http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00666.html
*** Bug 42820 has been marked as a duplicate of this bug. ***
Subject: Bug 42713 Author: dodji Date: Thu Jan 28 12:29:52 2010 New Revision: 156316 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156316 Log: Fix PR c++/42713 gcc/cp/ChangeLog: PR c++/42713 PR c++/42820 * typeck.c (get_template_parms_of_dependent_type): Factorized this out of incompatible_template_type_parms_p (incompatible_dependent_types_p): Renamed incompatible_template_type_parms_p into this. Make it detect two incompatible dependent typedefs too. (structural_comptypes): Use incompatible_dependent_types_p. * pt.c (get_template_info): Handle BOUND_TEMPLATE_TEMPLATE_PARAM. gcc/testsuite/ChangeLog: PR c++/42713 PR c++/42820 * g++.dg/template/typedef27.C: New test case. * g++.dg/template/typedef28.C: New test case. Added: trunk/gcc/testsuite/g++.dg/template/typedef27.C trunk/gcc/testsuite/g++.dg/template/typedef28.C trunk/gcc/testsuite/g++.dg/template/typedef29.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/pt.c trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog
Fixed in trunk.
Subject: Bug 42713 Author: hjl Date: Sun Feb 7 04:41:22 2010 New Revision: 156562 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156562 Log: Backport testcases from mainline to 4.4. 2010-02-06 H.J. Lu <hongjiu.lu@intel.com> Backport from mainline: 2010-02-05 Dodji Seketeli <dodji@redhat.com> PR c++/42915 * g++.dg/other/crash-9.C: New test. 2010-02-03 Jason Merrill <jason@redhat.com> PR c++/40138 * g++.dg/ext/builtin11.C: New. 2010-02-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/42944 * gcc.dg/errno-1.c: New testcase. 2010-02-03 Richard Guenther <rguenther@suse.de> PR middle-end/42927 * gcc.c-torture/compile/pr42927.c: New testcase. 2010-01-29 Dodji Seketeli <dodji@redhat.com> PR c++/42758 PR c++/42634 PR c++/42336 PR c++/42797 PR c++/42880 * g++.dg/other/crash-5.C: New test. * g++.dg/other/crash-7.C: New test. * g++.dg/other/crash-8.C: New test. 2010-01-28 Uros Bizjak <ubizjak@gmail.com> PR target/42891 * gcc.target/i386/pr42891.c: New test. 2010-01-28 Richard Guenther <rguenther@suse.de> PR middle-end/42883 * g++.dg/torture/pr42883.C: New testcase. 2010-01-28 Michael Matz <matz@suse.de> * gcc.target/i386/pr42881.c: New test. 2010-01-28 Dodji Seketeli <dodji@redhat.com> PR c++/42713 PR c++/42820 * g++.dg/template/typedef27.C: New test case. * g++.dg/template/typedef28.C: New test case. 2010-01-27 Jakub Jelinek <jakub@redhat.com> PR middle-end/42874 * gcc.dg/vla-22.c: New test. 2010-01-26 Richard Guenther <rguenther@suse.de> PR tree-optimization/42250 * gcc.dg/pr42250.c: New testcase. 2010-01-25 Tobias Burnus <burnus@net-b.de> PR fortran/42858 * gfortran.dg/generic_21.f90: New test. 2010-01-21 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42585 * gcc.dg/tree-ssa/pr42585.c: New test. 2010-01-20 Alexandre Oliva <aoliva@redhat.com> PR debug/42715 * gcc.dg/pr42715.c: New. 2010-01-20 Richard Guenther <rguenther@suse.de> PR tree-optimization/42717 * gcc.c-torture/compile/pr42717.c: New testcase. 2010-01-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/42783 * gfortran.dg/bounds_check_15.f90 : New test. 2010-01-18 Dodji Seketeli <dodji@redhat.com> PR c++/42766 * g++.dg/conversion/op6.C: New test. 2010-01-18 Richard Guenther <rguenther@suse.de> PR tree-optimization/42781 * gfortran.fortran-torture/compile/pr42781.f90: New testcase. 2010-01-17 Richard Guenther <rguenther@suse.de> PR middle-end/42248 * gcc.c-torture/execute/pr42248.c: New testcase. 2010-01-17 Janus Weil <janus@gcc.gnu.org> PR fortran/42677 * gfortran.dg/interface_assignment_5.f90: New test. 2010-01-15 Richard Guenther <rguenther@suse.de> PR middle-end/42739 * g++.dg/torture/pr42739.C: New testcase. 2010-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/42684 * gfortran.dg/interface_31.f90: New test. 2010-01-14 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42706 * gcc.dg/ipa/pr42706.c: New testcase. 2010-01-14 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42714 * g++.dg/torture/pr42714.C: New test. 2010-01-14 Alexander Monakov <amonakov@ispras.ru> PR rtl-optimization/42388 * gcc.dg/pr42388.c: New. 2010-01-14 Alexander Monakov <amonakov@ispras.ru> PR rtl-optimization/42294 * gfortran.dg/pr42294.f: New. 2010-01-14 Ira Rosen <irar@il.ibm.com> PR tree-optimization/42709 * gcc.dg/vect/pr42709.c: New test. 2010-01-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/42730 * gcc.c-torture/compile/pr42730.c: New testcase. 2010-01-13 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42704 * g++.dg/torture/pr42704.C: New test. 2010-01-13 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42703 * gcc.c-torture/compile/pr42703.c: New test. 2010-01-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/42705 * gcc.c-torture/compile/pr42705.c: New testcase. 2010-01-13 Richard Guenther <rguenther@suse.de> PR middle-end/42716 * gcc.c-torture/compile/pr42716.c: New testcase. 2010-01-12 Joseph Myers <joseph@codesourcery.com> PR c/42708 * gcc.c-torture/compile/pr42708-1.c: New test. 2010-01-09 Alexandre Oliva <aoliva@redhat.com> PR middle-end/42363 * gcc.dg/torture/pr42363.c: New. 2010-01-09 Alexandre Oliva <aoliva@redhat.com> PR debug/42604 PR debug/42395 * gcc.dg/vect/pr42604.c: New. * gcc.dg/vect/pr42395.c: New. 2010-01-09 Richard Guenther <rguenther@suse.de> PR middle-end/42512 * gcc.c-torture/execute/pr42512.c: New testcase. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/conversion/op6.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/conversion/op6.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/builtin11.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/ext/builtin11.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/crash-5.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/other/crash-5.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/crash-7.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/other/crash-7.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/crash-8.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/other/crash-8.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/crash-9.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/other/crash-9.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef27.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/template/typedef27.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef28.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/template/typedef28.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42704.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/torture/pr42704.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42714.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/torture/pr42714.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42739.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/torture/pr42739.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42883.C - copied unchanged from r156561, trunk/gcc/testsuite/g++.dg/torture/pr42883.C branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42703.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/compile/pr42703.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42705.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/compile/pr42705.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42708-1.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/compile/pr42708-1.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42716.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/compile/pr42716.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42717.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/compile/pr42717.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42730.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/compile/pr42730.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42927.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/compile/pr42927.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr42248.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/execute/pr42248.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr42512.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.c-torture/execute/pr42512.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/errno-1.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/errno-1.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/ipa/pr42706.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/ipa/pr42706.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42250.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/pr42250.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42388.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/pr42388.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42715.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/pr42715.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr42363.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/torture/pr42363.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/pr42395.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/vect/pr42395.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/pr42604.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/vect/pr42604.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/pr42709.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/vect/pr42709.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vla-22.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/vla-22.c branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42881.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.target/i386/pr42881.c branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42891.c - copied unchanged from r156561, trunk/gcc/testsuite/gcc.target/i386/pr42891.c branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/bounds_check_15.f90 - copied unchanged from r156561, trunk/gcc/testsuite/gfortran.dg/bounds_check_15.f90 branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/generic_21.f90 - copied unchanged from r156561, trunk/gcc/testsuite/gfortran.dg/generic_21.f90 branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/interface_31.f90 - copied unchanged from r156561, trunk/gcc/testsuite/gfortran.dg/interface_31.f90 branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/interface_assignment_5.f90 - copied unchanged from r156561, trunk/gcc/testsuite/gfortran.dg/interface_assignment_5.f90 branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr42294.f - copied unchanged from r156561, trunk/gcc/testsuite/gfortran.dg/pr42294.f branches/gcc-4_4-branch/gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90 - copied unchanged from r156561, trunk/gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90 Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog