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

--- Comment #63 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-14 
13:01:09 UTC ---
With a (seemingly) unrelated patch (attached to PR52097) I'm back on ICEing
for the gfortran.dg/lto/pr45586*.f90 testcases ...

Even before the adjusted type merging we have (at compile-time)

Breakpoint 5, output_gimple_stmt (ob=0x1c6c440, stmt=0x7ffff5b51730)
    at /space/rguenther/src/svn/trunk/gcc/gimple-streamer-out.c:138
138               stream_write_tree (ob, op, true);
y = D.1925_27->r;

(gdb) call debug_tree (gimple_assign_lhs (stmt)->typed.type)
 <record_type 0x7ffff5b4d2a0 array3_real(kind=8) type_1 BLK
    size <integer_cst 0x7ffff5b3e700 type <integer_type 0x7ffff5a2e0a8
bitsizetype> constant 768>
    unit size <integer_cst 0x7ffff5b1fc60 type <integer_type 0x7ffff5a2e000
sizetype> constant 96>
    align 64 symtab 0 alias set -1 canonical type 0x7ffff5b4a0a8
    fields <field_decl 0x7ffff5b3d7b8 data
        type <pointer_type 0x7ffff5a2ec78 type <void_type 0x7ffff5a2ebd0 void>
            public unsigned DI
            size <integer_cst 0x7ffff5a1dec0 constant 64>
            unit size <integer_cst 0x7ffff5a1dee0 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0x7ffff5a2ec78
            pointer_to_this <pointer_type 0x7ffff5a41f18>>

(gdb) call debug_tree (gimple_assign_rhs1 (stmt)->typed.type)
 <record_type 0x7ffff5b4a738 array3_real(kind=8) type_1 BLK
    size <integer_cst 0x7ffff5b3e700 type <integer_type 0x7ffff5a2e0a8
bitsizetype> constant 768>
    unit size <integer_cst 0x7ffff5b1fc60 type <integer_type 0x7ffff5a2e000
sizetype> constant 96>
    align 64 symtab 0 alias set -1 canonical type 0x7ffff5b4a0a8
    fields <field_decl 0x7ffff5b3dab0 data
        type <pointer_type 0x7ffff5a2ec78 type <void_type 0x7ffff5a2ebd0 void>
            public unsigned DI
            size <integer_cst 0x7ffff5a1dec0 constant 64>
            unit size <integer_cst 0x7ffff5a1dee0 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0x7ffff5a2ec78
            pointer_to_this <pointer_type 0x7ffff5a41f18>>

_BUT_(!) its main-variant is

(gdb) call debug_tree (gimple_assign_rhs1
(stmt)->typed.type->type_common.main_variant)
 <record_type 0x7ffff5b4a000 array3_real(kind=8) type_1 BLK
    size <integer_cst 0x7ffff5b3e700 type <integer_type 0x7ffff5a2e0a8
bitsizetype> constant 768>
    unit size <integer_cst 0x7ffff5b1fc60 type <integer_type 0x7ffff5a2e000
sizetype> constant 96>
    align 64 symtab 0 alias set -1 canonical type 0x7ffff5b4a0a8
    fields <field_decl 0x7ffff5b3d390 data
        type <pointer_type 0x7ffff5a41e70 type <void_type 0x7ffff5a2ebd0 void>
            unsigned restrict DI
            size <integer_cst 0x7ffff5a1dec0 constant 64>
            unit size <integer_cst 0x7ffff5a1dee0 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0x7ffff5a41e70>

thus has a restrict-qualified data field.  That's bogus as TYPE_FIELDS
is supposed to be shared amongst variant types.

Reply via email to