https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61211
Bug ID: 61211 Summary: [4.9/4.10 Regression] ICE: verify_cgraph_node failed: edge points to wrong declaration with -O3 -fno-inline Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Created attachment 32813 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32813&action=edit preprocessed source (g++.dg/ipa/pr60640-2.C) Maybe related to PR61160. Compiler output: $ gcc -O3 -fno-inline pr60640-2.ii /mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/ipa/pr60640-2.C:15:8: error: edge points to wrong declaration: H h (0); ^ <function_decl 0x7f22df2e3700 f.constprop type <function_type 0x7f22df2d7348 type <integer_type 0x7f22df143738 unsigned int public unsigned SI size <integer_cst 0x7f22df141a68 constant 32> unit size <integer_cst 0x7f22df141a80 constant 4> align 32 symtab 0 alias set -1 canonical type 0x7f22df143738 precision 32 min <integer_cst 0x7f22df141a98 0> max <integer_cst 0x7f22df141a50 4294967295> pointer_to_this <pointer_type 0x7f22df259150>> QI size <integer_cst 0x7f22df141918 constant 8> unit size <integer_cst 0x7f22df141930 constant 1> align 8 symtab 0 alias set -1 canonical type 0x7f22df2d7348 arg-types <tree_list 0x7f22df140bb8 value <void_type 0x7f22df155000 void>>> readonly addressable used nothrow static autoinline decl_5 QI defer-output file /mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/ipa/pr60640-2.C line 8 col 25 align 16 context <record_type 0x7f22df2b93f0 G> initial <block 0x7f22df2bccd0> abstract_origin <function_decl 0x7f22df298500 f> result <result_decl 0x7f22df2bb618 D.2515 type <integer_type 0x7f22df143738 unsigned int> used unsigned ignored SI file /mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/ipa/pr60640-2.C line 8 col 40 size <integer_cst 0x7f22df141a68 32> unit size <integer_cst 0x7f22df141a80 4> align 32 context <function_decl 0x7f22df2e3700 f.constprop> abstract_origin <result_decl 0x7f22df2bb000 D.2283>> struct-function 0x7f22df2cb540> Instead of: <function_decl 0x7f22df2b6100 _ZThn8_NK1G1fEb type <method_type 0x7f22df2b9690 type <integer_type 0x7f22df143738 unsigned int public unsigned SI size <integer_cst 0x7f22df141a68 constant 32> unit size <integer_cst 0x7f22df141a80 constant 4> align 32 symtab 0 alias set -1 canonical type 0x7f22df143738 precision 32 min <integer_cst 0x7f22df141a98 0> max <integer_cst 0x7f22df141a50 4294967295> pointer_to_this <pointer_type 0x7f22df259150>> QI size <integer_cst 0x7f22df141918 constant 8> unit size <integer_cst 0x7f22df141930 constant 1> align 8 symtab 0 alias set -1 canonical type 0x7f22df2b9690 method basetype <record_type 0x7f22df2b93f0 G> arg-types <tree_list 0x7f22df2999d8 value <pointer_type 0x7f22df2b9738> chain <tree_list 0x7f22df299500 value <boolean_type 0x7f22df143bd0 bool> chain <tree_list 0x7f22df140bb8 value <void_type 0x7f22df155000 void>>>> pointer_to_this <pointer_type 0x7f22df2b99d8>> readonly addressable asm_written used nothrow public weak virtual decl_5 QI file /mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/ipa/pr60640-2.C line 8 col 25 align 8 context <record_type 0x7f22df2b93f0 G> arguments <parm_decl 0x7f22df2b0780 this type <pointer_type 0x7f22df2b97e0 type <record_type 0x7f22df2b95e8 G> readonly unsigned DI size <integer_cst 0x7f22df141828 constant 64> unit size <integer_cst 0x7f22df141840 constant 8> align 64 symtab 0 alias set -1 canonical type 0x7f22df2b97e0> readonly unsigned DI file /mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/ipa/pr60640-2.C line 8 col 34 size <integer_cst 0x7f22df141828 64> unit size <integer_cst 0x7f22df141840 8> align 64 context <function_decl 0x7f22df2b6100 _ZThn8_NK1G1fEb> arg-type <pointer_type 0x7f22df2b97e0> chain <parm_decl 0x7f22df2b0800 D.2288 type <boolean_type 0x7f22df143bd0 bool> unsigned QI file /mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/ipa/pr60640-2.C line 8 col 28 size <integer_cst 0x7f22df141918 8> unit size <integer_cst 0x7f22df141930 1> align 8 context <function_decl 0x7f22df2b6100 _ZThn8_NK1G1fEb> arg-type <integer_type 0x7f22df143690 int>>> full-name "virtual unsigned int G::_ZThn8_NK1G1fEb(bool) const" > _ZNK1H1fEv/3 (virtual unsigned int H::f() const) @0x7f22df2c0000 Type: function definition analyzed Visibility: externally_visible public weak comdat comdat_group:_ZNK1H1fEv one_only virtual Address is taken. References: Referring: _ZTV1H/5 (addr) Availability: available First run: 0 Function flags: body Called by: Calls: _ZNK1G1fEb.constprop.1/41 (1.00 per call) (can throw external) /mnt/svn/gcc-trunk/gcc/testsuite/g++.dg/ipa/pr60640-2.C:15:8: internal compiler error: verify_cgraph_node failed 0x941bff verify_cgraph_node(cgraph_node*) /mnt/svn/gcc-trunk/gcc/cgraph.c:2996 0x942987 verify_cgraph() /mnt/svn/gcc-trunk/gcc/cgraph.c:3011 0x94e3d7 cgraph_materialize_all_clones() /mnt/svn/gcc-trunk/gcc/cgraphclones.c:1134 0x94ab17 compile() /mnt/svn/gcc-trunk/gcc/cgraphunit.c:2208 0x94b844 finalize_compilation_unit() /mnt/svn/gcc-trunk/gcc/cgraphunit.c:2329 0x7291ae cp_write_global_declarations() /mnt/svn/gcc-trunk/gcc/cp/decl2.c:4625 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. Tested revisions: r210490 - ICE 4.9 r210307 - ICE 4.8 r210303 - OK 4.7 r210302 - OK 4.6 r197894 - OK