Command line:
$ g++ -O[123] -fipa-cp -fipa-cp-clone testcase.C

Compiler output:
$ /mnt/svn/gcc-trunk/binary-160112-lto-fortran/bin/g++ -O1 -fipa-cp
-fipa-cp-clone testcase.C
testcase.C: In function 'void f(S3<int>)':                                      
testcase.C:13:5: error: edge points to wrong declaration:                       
 <function_decl 0x7fa6d860ad00 _ZN2S2C2Ei.constprop.1                           
    type <method_type 0x7fa6d8608a80                                            
        type <void_type 0x7fa6da9c5e70 void type_6 VOID                         
            align 8 symtab 0 alias set -1 canonical type 0x7fa6da9c5e70         
            pointer_to_this <pointer_type 0x7fa6da9c5f18>>                      
        QI                                                                      
        size <integer_cst 0x7fa6da9af730 constant 8>                            
        unit size <integer_cst 0x7fa6da9af758 constant 1>                       
        align 8 symtab 0 alias set -1 canonical type 0x7fa6d85f0150 method
basetype <record_type 0x7fa6d85e8a80 S2>    
        arg-types <tree_list 0x7fa6d8606cd0 value <pointer_type 0x7fa6d85e8e70> 
            chain <tree_list 0x7fa6da9d55c8 value <void_type 0x7fa6da9c5e70
void>>>                                    
        pointer_to_this <pointer_type 0x7fa6d85f87e0>>                          
    asm_written nothrow static autoinline decl_5 QI file testcase.C line 23 col
3 align 16 context <record_type 0x7fa6d85e8a80 S2> initial <error_mark
0x7fa6da9b7ca8> abstract_origin <function_decl 0x7fa6d85ec400 S2>               
    arguments <parm_decl 0x7fa6d85febb0 this                                    
        type <pointer_type 0x7fa6d85f0000 type <record_type 0x7fa6d85e8a80 S2>  
            readonly unsigned type_6 DI                                         
            size <integer_cst 0x7fa6da9afa28 constant 64>                       
            unit size <integer_cst 0x7fa6da9afa50 constant 8>                   
            align 64 symtab 0 alias set -1 canonical type 0x7fa6d85f0000>       
        readonly used unsigned DI file testcase.C line 23 col 12 size
<integer_cst 0x7fa6da9afa28 64> unit size <integer_cst 0x7fa6da9afa50 8>        
        align 64 context <function_decl 0x7fa6d860ad00 _ZN2S2C2Ei.constprop.1>
abstract_origin <parm_decl 0x7fa6da9b9cc0 this>                                 
        (reg/f:DI 5 di [orig:110 this ] [110]) arg-type <pointer_type
0x7fa6d85f0000>                                        
        incoming-rtl (reg:DI 5 di [ this ])>                                    
    result <result_decl 0x7fa6d8609780 D.2307 type <void_type 0x7fa6da9c5e70
void>                                           
        used ignored VOID file testcase.C line 24 col 5                         
        align 8 context <function_decl 0x7fa6d860ad00 _ZN2S2C2Ei.constprop.1>
abstract_origin <result_decl 0x7fa6d85ed300 D.2174>>                            
    full-name "S2::S2()"                                                        
    pending-inline-info 0x7fa6d85f60e0                                          
    (mem:QI (symbol_ref:DI ("_ZN2S2C2Ei.constprop.1") [flags 0x3]
<function_decl 0x7fa6d860ad00 _ZN2S2C2Ei.constprop.1>) [0 S1 A8])>              
 Instead of: <function_decl 0x7fa6d85ec500 __comp_ctor                          
    type <method_type 0x7fa6d85f0150                                            
        type <void_type 0x7fa6da9c5e70 void type_6 VOID                         
            align 8 symtab 0 alias set -1 canonical type 0x7fa6da9c5e70         
            pointer_to_this <pointer_type 0x7fa6da9c5f18>>                      
        QI
        size <integer_cst 0x7fa6da9af730 constant 8>
        unit size <integer_cst 0x7fa6da9af758 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7fa6d85f0150 method
basetype <record_type 0x7fa6d85e8a80 S2>
        arg-types <tree_list 0x7fa6d85ea8c0 value <pointer_type 0x7fa6d85e8e70>
            chain <tree_list 0x7fa6da9d5f78 value <integer_type 0x7fa6da9c5498
int>
                chain <tree_list 0x7fa6da9d55c8 value <void_type 0x7fa6da9c5e70
void>>>>
        pointer_to_this <pointer_type 0x7fa6d85f87e0>>
    addressable used nothrow public static weak autoinline decl_5 QI
defer-output file testcase.C line 23 col 3 align 16 context <record_type
0x7fa6d85e8a80 S2> initial <block 0x7fa6d85ee3c8> abstract_origin
<function_decl 0x7fa6d85ec400 S2>
    arguments <parm_decl 0x7fa6da9b9d48 this
        type <pointer_type 0x7fa6d85f0000 type <record_type 0x7fa6d85e8a80 S2>
            readonly unsigned type_6 DI
            size <integer_cst 0x7fa6da9afa28 constant 64>
            unit size <integer_cst 0x7fa6da9afa50 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0x7fa6d85f0000>
        readonly used unsigned DI file testcase.C line 23 col 12 size
<integer_cst 0x7fa6da9afa28 64> unit size <integer_cst 0x7fa6da9afa50 8>
        align 64 context <function_decl 0x7fa6d85ec500 __comp_ctor >
abstract_origin <parm_decl 0x7fa6da9b9cc0 this> arg-type <pointer_type
0x7fa6d85f0000>
        chain <parm_decl 0x7fa6da9b9dd0 i type <integer_type 0x7fa6da9c5498
int>
            used SI file testcase.C line 23 col 11
            size <integer_cst 0x7fa6da9af960 constant 32>
            unit size <integer_cst 0x7fa6da9af668 constant 4>
            align 32 context <function_decl 0x7fa6d85ec500 __comp_ctor >
abstract_origin <parm_decl 0x7fa6da9b9c38 i>
            arg-type <integer_type 0x7fa6da9c5498 int>>>
    result <result_decl 0x7fa6d85ed380 D.2178 type <void_type 0x7fa6da9c5e70
void>
        ignored VOID file testcase.C line 24 col 5
        align 8 context <function_decl 0x7fa6d85ec500 __comp_ctor >>
    full-name "S2::S2(int)"
    pending-inline-info 0x7fa6d85f61c0
    struct-function 0x7fa6da9bc870>
void f(S3<int>)/16(-1) @0x7fa6d8612000 (asm: _ZL1f2S3IiE) (inline copy in void
f(S3<int>)/6) (clone of void f(S3<int>)/18) availability:local analyzed 13
time, 11 benefit 10 size, 2 benefit (26 after inlining) 404 bytes stack usage
reachable body local finalized inlinable
  called by: void f(S3<int>)/6 (0.00 per call) (inlined)
  calls: void f(S3<int>)/17 (inlined) (0.00 per call) (nested in 6 loops)
S2::S2()/12 (0.00 per call) (nested in 6 loops)
  References:  var:bool m (read)
  Refering this function:
testcase.C:13:5: internal compiler error: verify_cgraph_node failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r160122 - crash
r160112 - crash
r160052 - crash
r159696 - OK


-- 
           Summary: [4.6 Regression] ICE: verify_cgraph_node failed: edge
                    points to wrong declaration with -fipa-cp-clone
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zsojka at seznam dot cz
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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

Reply via email to