[Bug c++/21123] [4.0 regression] ICE in cp_expr_size, at cp/cp-objcp-common.c:101

dave at hiauly1 dot hia dot nrc dot ca gcc-bugzilla@gcc.gnu.org
Wed Jul 27 20:24:00 GMT 2005


------- Additional Comments From dave at hiauly1 dot hia dot nrc dot ca  2005-07-27 20:17 -------
Subject: Re:  [4.0 regression] ICE in cp_expr_size, at cp/cp-objcp-common.c:101

> Thus, it looks as if the ICE is caused by a
> tree check failure in the assert at cp/cp-objcp-common.c:101, rather
> than the assert itself.  

Actually, it's the enabling of assert checking that catches this
problem.

The problem can be duplicated with an x86 cross to hppa-unknown-linux-gnu.
Here is some debug output:

Breakpoint 1, fancy_abort (
    file=0x84d9e38 "../../gcc/gcc/cp/cp-objcp-common.c", line=101,
    function=0x84d9de5 "cp_expr_size") at ../../gcc/gcc/diagnostic.c:590
590       internal_error ("in %s, at %s:%d", function, trim_filename (file), line);
(gdb) bt
#0  fancy_abort (file=0x84d9e38 "../../gcc/gcc/cp/cp-objcp-common.c",
    line=101, function=0x84d9de5 "cp_expr_size")
    at ../../gcc/gcc/diagnostic.c:590
During symbol reading, Incomplete CFI data; unspecified registers at 0x0826776d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0826776d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0826776d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0826776d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0826776d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0826776d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0826776d.
#1  0x0812c516 in cp_expr_size (exp=0x4021f820)
    at ../../gcc/gcc/cp/cp-objcp-common.c:85
During symbol reading, Incomplete CFI data; unspecified registers at 0x0812c584.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0812c584.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0812c584.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0812c584.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0812c584.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0812c584.
#2  0x082907f2 in expr_size (exp=0x4021f820) at ../../gcc/gcc/explow.c:246
During symbol reading, Incomplete CFI data; unspecified registers at 0x08290840.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08290840.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08290840.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08290840.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08290840.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08290840.
#3  0x082a4c7a in store_expr (exp=0x4021f820, target=0x40223fc0,
    call_param_p=0) at ../../gcc/gcc/expr.c:4267
During symbol reading, Incomplete CFI data; unspecified registers at 0x082a4d74.
#4  0x082a44e9 in expand_assignment (to=0x4022b9c0, from=0x4021f820)
    at ../../gcc/gcc/expr.c:4099
#5  0x082b4017 in expand_expr_real_1 (exp=0x4022d240, target=0x0,
    tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0)
    at ../../gcc/gcc/expr.c:8279
#6  0x082aa838 in expand_expr_real (exp=0x4022d240, target=0x4014f210,
    tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0)
    at ../../gcc/gcc/expr.c:6456
#7  0x0838a099 in expand_expr_stmt (exp=0x4022d240) at expr.h:492
#8  0x083c97ac in expand_gimple_basic_block (bb=0x40226e10, dump_file=0x0)
    at ../../gcc/gcc/cfgexpand.c:1326
#9  0x083c9ef4 in tree_expand_cfg () at ../../gcc/gcc/cfgexpand.c:1521
#10 0x083c6206 in execute_one_pass (pass=0x8559fe0)
    at ../../gcc/gcc/passes.c:790
#11 0x083c62af in execute_pass_list (pass=0x8559fe0)
---Type <return> to continue, or q <return> to quit---
    at ../../gcc/gcc/passes.c:822
#12 0x0818ea05 in tree_rest_of_compilation (fndecl=0x401f0d80)
    at ../../gcc/gcc/tree-optimize.c:419
#13 0x0811469d in expand_body (fn=0x401f0d80)
    at ../../gcc/gcc/cp/semantics.c:3008
#14 0x081060ab in use_thunk (thunk_fndecl=0x401f0d80, emit_p=1 '\001')
    at ../../gcc/gcc/cp/method.c:520
#15 0x081144ec in emit_associated_thunks (fn=0x4021f820)
    at ../../gcc/gcc/cp/semantics.c:2961
#16 0x08114671 in expand_body (fn=0x401d0280)
    at ../../gcc/gcc/cp/semantics.c:3001
#17 0x083f7579 in cgraph_expand_function (node=0x402032d8)
    at ../../gcc/gcc/cgraphunit.c:1033
#18 0x083f7707 in cgraph_expand_all_functions ()
    at ../../gcc/gcc/cgraphunit.c:1099
#19 0x083f7c0e in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1256
#20 0x080c2ced in cp_finish_file () at ../../gcc/gcc/cp/decl2.c:3094
#21 0x08049afa in finish_file () at ../../gcc/gcc/cp/cp-lang.c:149
#22 0x08166cb8 in c_common_parse_file (set_yydebug=1075792704)
    at ../../gcc/gcc/c-opts.c:1117
#23 0x08396cfe in compile_file () at ../../gcc/gcc/toplev.c:971
#24 0x0839813f in do_compile () at ../../gcc/gcc/toplev.c:1937
#25 0x08398197 in toplev_main (argc=10, argv=0xbffff484)
    at ../../gcc/gcc/toplev.c:1969
#26 0x0816fec3 in main (argc=10, argv=0xbffff484) at ../../gcc/gcc/main.c:35
(gdb) frame 1
#1  0x0812c516 in cp_expr_size (exp=0x4021f820)
    at ../../gcc/gcc/cp/cp-objcp-common.c:85
85            gcc_assert (!TYPE_HAS_COMPLEX_INIT_REF (type)
(gdb) p debug_tree (exp)
 <call_expr 0x4021f820
    type <record_type 0x401fa508 vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > sizes-gimplified addressable needs-constructing type_1 type_4 type_5 BLK
        size <integer_cst 0x4014b0d8 constant invariant 8>
        unit size <integer_cst 0x4014b0f0 constant invariant 1>
        align 8 symtab 0 alias set -1
        fields <field_decl 0x40204958 D.1916 type <record_type 0x401fd450 _Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >>
            ignored decl_6 BLK file mcop.ii line 94 size <integer_cst 0x4014b0d8 8> unit size <integer_cst 0x4014b0f0 1>
            align 8 offset_align 64
            offset <integer_cst 0x4014b078 constant invariant 0>
            bit offset <integer_cst 0x4014b810 constant invariant 0> context <record_type 0x401fa508 vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> chain <type_decl 0x401f55b0 vector>> context <namespace_decl 0x40162068 std>
       needs-constructor needs-destructor X() X(constX&) this=(X&) n_parents=1 use_template=1 interface-unknown
        pointer_to_this <pointer_type 0x401fdebc> reference_to_this <reference_type 0x402040b8> chain <type_decl 0x401f5d68 vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >>>
    side-effects protected
    arg 0 <addr_expr 0x40222e40
        type <pointer_type 0x40208c94 type <method_type 0x401faf74>
            unsigned SI
            size <integer_cst 0x4014b2d0 constant invariant 32>
            unit size <integer_cst 0x4014b060 constant invariant 4>
            align 32 symtab 0 alias set -1>
        constant invariant
        arg 0 <function_decl 0x40229200 *.LTHUNK0 type <method_type 0x401faf74>
            addressable used no-static-chain decl_5 decl_6 SI file mcop.ii line 134 initial <error_mark 0x40150d00>

            (mem:SI (symbol_ref/v:SI ("@*.LTHUNK0") [flags 0x3] <function_decl 0x40229200 *.LTHUNK0>) [0 S4 A32])>>
    arg 1 <tree_list 0x4021c948
        value <var_decl 0x4022f108 D.2077 type <pointer_type 0x401fd05c>
            used unsigned ignored SI file mcop.ii line 134 size <integer_cst 0x4014b2d0 32> unit size <integer_cst 0x4014b060 4>
            align 32 context <function_decl 0x401f0d80 _ZTv0_n12_NK4Arts18InterfaceRepo_base15_defaultPortsInEv>
            (reg:SI 94 [ D.2077 ])>>
    mcop.ii:134>
$1 = void
(gdb) p debug_tree (type)
 <record_type 0x401fa508 vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > sizes-gimplified addressable needs-constructing type_1 type_4 type_5 BLK
    size <integer_cst 0x4014b0d8 type <integer_type 0x4015b05c bit_size_type> constant invariant 8>
    unit size <integer_cst 0x4014b0f0 type <integer_type 0x4015b000 unsigned int> constant invariant 1>
    align 8 symtab 0 alias set -1
    fields <field_decl 0x40204958 D.1916
        type <record_type 0x401fd450 _Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > sizes-gimplified addressable needs-constructing type_1 type_4 type_5 type_6 BLK size <integer_cst 0x4014b0d8 8> unit size <integer_cst 0x4014b0f0 1>
            align 8 symtab 0 alias set -1 fields <field_decl 0x401fd7e8 _M_impl> context <namespace_decl 0x40162068 std>
           needs-constructor needs-destructor X(constX&) this=(X&) n_parents=0 use_template=1 interface-unknown
            pointer_to_this <pointer_type 0x401fd508> reference_to_this <reference_type 0x40204170> chain <type_decl 0x401f5f70 _Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >>>
        ignored decl_6 BLK file mcop.ii line 94 size <integer_cst 0x4014b0d8 8> unit size <integer_cst 0x4014b0f0 1>
        align 8 offset_align 64
        offset <integer_cst 0x4014b078 constant invariant 0>
        bit offset <integer_cst 0x4014b810 constant invariant 0> context <record_type 0x401fa508 vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >>
        chain <type_decl 0x401f55b0 vector type <record_type 0x401fa508 vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >>
            external nonlocal suppress-debug decl_4 VOID file mcop.ii line 94
            align 8 context <record_type 0x401fa508 vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >>
            chain <type_decl 0x402030d0 _Base>>> context <namespace_decl 0x40162068 std>
   needs-constructor needs-destructor X() X(constX&) this=(X&) n_parents=1 use_template=1 interface-unknown
    pointer_to_this <pointer_type 0x401fdebc> reference_to_this <reference_type 0x402040b8> chain <type_decl 0x401f5d68 vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >>>
$2 = void

"type" is record_type but CLASSTYPE_NON_AGGREGATE (type) is true, so
CP_AGGREGATE_TYPE_P is false.  It would appear that cp_expr_size shouldn't
be called in this situation...

The problem occurs on hppa-unknown-linux-gnu as well as hppa*-*-hpux*.

Dave


-- 


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



More information about the Gcc-bugs mailing list