[Bug c++/47311] New: [C++0x] ICE in tsubst @cp/pt.c:10502

pluto at agmk dot net gcc-bugzilla@gcc.gnu.org
Sat Jan 15 22:53:00 GMT 2011


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

           Summary: [C++0x] ICE in tsubst @cp/pt.c:10502
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pluto@agmk.net


current gcc-trunk (r168844) ICEs on my codebase:

10484│     case BOUND_TEMPLATE_TEMPLATE_PARM:
10485│     case TEMPLATE_PARM_INDEX:
10486│       {
10487│         int idx;
10488│         int level;
10489│         int levels;
10490│         tree arg = NULL_TREE;
10491│
10492│         r = NULL_TREE;
10493│
10494│         gcc_assert (TREE_VEC_LENGTH (args) > 0);
10495│         template_parm_level_and_index (t, &level, &idx);
10496│
10497│         levels = TMPL_ARGS_DEPTH (args);
10498│         if (level <= levels)
10499│           {
10500│             arg = TMPL_ARG (args, level, idx);
10501│
10502├>            if (arg && TREE_CODE (arg) == ARGUMENT_PACK_SELECT)
10503│               /* See through ARGUMENT_PACK_SELECT arguments. */
10504│               arg = ARGUMENT_PACK_SELECT_ARG (arg);
10505│           }
10506│
10507│         if (arg == error_mark_node)
10508│           return error_mark_node;
10509│         else if (arg != NULL_TREE)
10510│           {
10511│             if (ARGUMENT_PACK_P (arg))
10512│               /* If ARG is an argument pack, we don't actually want to
10513│                  perform a substitution here, because substitutions
10514│                  for argument packs are only done
10515│                  element-by-element. We can get to this point when
10516│                  substituting the type of a non-type template
10517│                  parameter pack, when that type actually contains
10518│                  template parameter packs from an outer template, e.g.,
10519│
/home/users/pluto/alatek/toolchain/trunk/gcc-trunk/gcc/cp/pt.c

(gdb) r
Starting program:
/local/devel/toolchain46/x86_64-gnu-linux.host64/bin/x86_64-gnu-linux-g++ -c
-DHDL_EXPORTS -D_GNU_SOURCE -D_GLIBCXX_DEBUG -D_DEBUG -DBOOST_EXCEPTION_DISABLE
-pthread -Wall -Wno-uninitialized -Wno-deprecated -Wsign-compa
re -Wtype-limits -Woverloaded-virtual -Werror -mcld -fdwarf2-cfi-asm
-feliminate-unused-debug-types -march=x86-64 -O1 -gdwarf-4 -g2
-fno-strict-aliasing -fno-schedule-insns -fno-schedule-insns2 -std=gnu++0x
-fPIC -O2 -I./h -I./factories
-I./utils -I../VCM/h -I../def/h -I../hescore/h -isystem
../../buildenv/linux/gcc-4.6/64/boost-1.44.0/include -I../debugtools/h
-I../au/h -I../dp/h hdlVhdlArchitecture.cpp -o
obj-debug-x86_64-gnu-linux/hdlVhdlArchitecture.o
[New process 17639]
process 17639 is executing new program:
/local/devel/toolchain46/x86_64-gnu-linux.host64/lib64/gcc/x86_64-gnu-linux/4.6.0/cc1plus

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 17639]
0x0000000000436c63 in tsubst (t=0x7ffff2fbfb28, args=0x7ffff2fbe540,
complain=0, in_decl=0x7ffff2fc18a0) at ../../gcc/cp/pt.c:10502
(gdb) bt
#0  0x0000000000436c63 in tsubst (t=0x7ffff2fbfb28, args=0x7ffff2fbe540,
complain=0, in_decl=0x7ffff2fc18a0) at ../../gcc/cp/pt.c:10502
#1  0x000000000044262c in fixup_template_parm (parm_desc=0x7ffff2fbaac8,
idx=<value optimized out>, num_parms=2, arglist=0x7ffff2fbe540) at
../../gcc/cp/pt.c:3879
#2  0x00000000004428f9 in fixup_template_parms (parms=<value optimized out>) at
../../gcc/cp/pt.c:3918
#3  end_template_parm_list (parms=<value optimized out>) at
../../gcc/cp/pt.c:3617
#4  0x0000000000477c38 in cp_parser_template_parameter_list
(parser=0x7ffff66ed420) at ../../gcc/cp/parser.c:11188
#5  0x0000000000477e0a in cp_parser_type_parameter (parser=0x7ffff66ed420,
is_parameter_pack=0x7fffffffd28f "") at ../../gcc/cp/parser.c:11445
#6  0x0000000000477bfb in cp_parser_template_parameter (parser=0x7ffff66ed420)
at ../../gcc/cp/parser.c:11250
#7  cp_parser_template_parameter_list (parser=0x7ffff66ed420) at
../../gcc/cp/parser.c:11164
#8  0x00000000004794a3 in cp_parser_template_declaration_after_export
(parser=0x7ffff66ed420, member_p=0 '\000') at ../../gcc/cp/parser.c:19932
#9  0x000000000047c84a in cp_parser_declaration (parser=0x7ffff66ed420) at
../../gcc/cp/parser.c:9453
#10 0x000000000047b915 in cp_parser_declaration_seq_opt (parser=0x7ffff66ed420)
at ../../gcc/cp/parser.c:9383
#11 0x000000000047bab9 in cp_parser_namespace_body (parser=0x7ffff66ed420) at
../../gcc/cp/parser.c:13930
#12 cp_parser_namespace_definition (parser=0x7ffff66ed420) at
../../gcc/cp/parser.c:13911
#13 0x000000000047c7f8 in cp_parser_declaration (parser=0x7ffff66ed420) at
../../gcc/cp/parser.c:9485
#14 0x000000000047b915 in cp_parser_declaration_seq_opt (parser=0x7ffff66ed420)
at ../../gcc/cp/parser.c:9383
#15 0x000000000047cb85 in cp_parser_translation_unit () at
../../gcc/cp/parser.c:3463
#16 c_parse_file () at ../../gcc/cp/parser.c:25278
#17 0x00000000004fda75 in c_common_parse_file () at
../../gcc/c-family/c-opts.c:1071
#18 0x0000000000727974 in compile_file (argc=62, argv=0x7fffffffd5f8) at
../../gcc/toplev.c:579
#19 do_compile (argc=62, argv=0x7fffffffd5f8) at ../../gcc/toplev.c:1874
#20 toplev_main (argc=62, argv=0x7fffffffd5f8) at ../../gcc/toplev.c:1937
#21 0x00007ffff7a8fcbd in __libc_start_main (main=0x50bdb0 <main>, argc=62,
ubp_av=0x7fffffffd5f8, init=<value optimized out>, fini=<value optimized out>,
rtld_fini=<value optimized out>, stack_end=0x7fffffffd5e8) at libc-start.c:226
#22 0x0000000000402889 in _start () at ../sysdeps/x86_64/elf/start.S:113


accidentally, the --save-temps (or -std=gnu++98) removes the ICE,
so how can i produce a preprocessed source for full bug report?



More information about the Gcc-bugs mailing list