https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61160

--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> ---
Created attachment 32786
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32786&action=edit
testcase causing ICE

Slightly modified, "struct A" replaced by "void *".

Compiler output:
$ g++ -O3 testcase.C
testcase.C:28:1: error: edge points to wrong declaration:
 }
 ^
 <function_decl 0x7f09e2392600
_ZThn8_N8CExample9MixinFuncEiPv.artificial_thunk.1.artificial_thunk.3
    type <method_type 0x7f09e237c348
        type <pointer_type 0x7f09e22130a8 type <void_type 0x7f09e2213000 void>
            public unsigned DI
            size <integer_cst 0x7f09e21edf78 constant 64>
            unit size <integer_cst 0x7f09e21edf90 constant 8>
            align 64 symtab 0 alias set 3 canonical type 0x7f09e22130a8
            pointer_to_this <pointer_type 0x7f09e2219e70>>
        QI
        size <integer_cst 0x7f09e220c078 constant 8>
        unit size <integer_cst 0x7f09e220c090 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7f09e237c348 method
basetype <record_type 0x7f09e2374000 CExample>
        arg-types <tree_list 0x7f09e2396708 value <pointer_type 0x7f09e23742a0>
            chain <tree_list 0x7f09e21fdbb8 value <void_type 0x7f09e2213000
void>>>>
    readonly addressable used decl_5 QI file testcase.C line 11 col 9 align 8
context <record_type 0x7f09e2374000 CExample>
    arguments <parm_decl 0x7f09e236d580 this
        type <pointer_type 0x7f09e2374348 type <record_type 0x7f09e2374000
CExample>
            readonly unsigned DI size <integer_cst 0x7f09e21edf78 64> unit size
<integer_cst 0x7f09e21edf90 8>
            align 64 symtab 0 alias set -1 canonical type 0x7f09e2374348>
        readonly unsigned DI file testcase.C line 11 col 39 size <integer_cst
0x7f09e21edf78 64> unit size <integer_cst 0x7f09e21edf90 8>
        align 64 context <function_decl 0x7f09e235ce00
_ZThn8_N8CExample9MixinFuncEiPv> arg-type <pointer_type 0x7f09e2374348>
        chain <parm_decl 0x7f09e236d600 arg type <integer_type 0x7f09e21ff690
int>
            used SI file testcase.C line 11 col 24
            size <integer_cst 0x7f09e220c1c8 constant 32>
            unit size <integer_cst 0x7f09e220c1e0 constant 4>
            align 32 context <function_decl 0x7f09e235ce00
_ZThn8_N8CExample9MixinFuncEiPv>
            arg-type <integer_type 0x7f09e21ff690 int> chain <parm_decl
0x7f09e236d680 arg2>>>>
 Instead of: <function_decl 0x7f09e235ce00 _ZThn8_N8CExample9MixinFuncEiPv
    type <method_type 0x7f09e23741f8
        type <pointer_type 0x7f09e22130a8 type <void_type 0x7f09e2213000 void>
            public unsigned DI
            size <integer_cst 0x7f09e21edf78 constant 64>
            unit size <integer_cst 0x7f09e21edf90 constant 8>
            align 64 symtab 0 alias set 3 canonical type 0x7f09e22130a8
            pointer_to_this <pointer_type 0x7f09e2219e70>>
        QI
        size <integer_cst 0x7f09e220c078 constant 8>
        unit size <integer_cst 0x7f09e220c090 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7f09e23741f8 method
basetype <record_type 0x7f09e2374000 CExample>
        arg-types <tree_list 0x7f09e2356938 value <pointer_type 0x7f09e23742a0>
            chain <tree_list 0x7f09e2356618 value <integer_type 0x7f09e21ff690
int>
                chain <tree_list 0x7f09e2356640 value <pointer_type
0x7f09e22130a8>
                    chain <tree_list 0x7f09e21fdbb8 value <void_type
0x7f09e2213000 void>>>>>
        pointer_to_this <pointer_type 0x7f09e2374888>>
    readonly addressable asm_written used public weak virtual decl_5 QI file
testcase.C line 11 col 9 align 8 context <record_type 0x7f09e2374000 CExample>
    arguments <parm_decl 0x7f09e236d580 this
        type <pointer_type 0x7f09e2374348 type <record_type 0x7f09e2374000
CExample>
            readonly unsigned DI size <integer_cst 0x7f09e21edf78 64> unit size
<integer_cst 0x7f09e21edf90 8>
            align 64 symtab 0 alias set -1 canonical type 0x7f09e2374348>
        readonly unsigned DI file testcase.C line 11 col 39 size <integer_cst
0x7f09e21edf78 64> unit size <integer_cst 0x7f09e21edf90 8>
        align 64 context <function_decl 0x7f09e235ce00
_ZThn8_N8CExample9MixinFuncEiPv> arg-type <pointer_type 0x7f09e2374348>
        chain <parm_decl 0x7f09e236d600 arg type <integer_type 0x7f09e21ff690
int>
            used SI file testcase.C line 11 col 24
            size <integer_cst 0x7f09e220c1c8 constant 32>
            unit size <integer_cst 0x7f09e220c1e0 constant 4>
            align 32 context <function_decl 0x7f09e235ce00
_ZThn8_N8CExample9MixinFuncEiPv>
            arg-type <integer_type 0x7f09e21ff690 int> chain <parm_decl
0x7f09e236d680 arg2>>>
    full-name "virtual void* CExample::_ZThn8_N8CExample9MixinFuncEiPv(int,
void*)"
   >
main/14 (int main()) @0x7f09e237f7b0
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  First run: 0
  Function flags: body only_called_at_startup
  Called by: 
  Calls:
_ZThn8_N8CExample9MixinFuncEiPv.artificial_thunk.1.artificial_thunk.3/38 (1.00
per call) (can throw external) 
testcase.C:28:1: internal compiler error: verify_cgraph_node failed
0x94409f verify_cgraph_node(cgraph_node*)
        /mnt/svn/gcc-trunk/gcc/cgraph.c:2996
0x93f27e verify_symtab_node(symtab_node*)
        /mnt/svn/gcc-trunk/gcc/symtab.c:882
0x93f2b7 verify_symtab()
        /mnt/svn/gcc-trunk/gcc/symtab.c:899
0xb47f9f symtab_remove_unreachable_nodes(bool, _IO_FILE*)
        /mnt/svn/gcc-trunk/gcc/ipa.c:308
0xc1a827 execute_todo
        /mnt/svn/gcc-trunk/gcc/passes.c:1843
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Reply via email to