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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Created attachment 46781
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46781&action=edit
Test-case #2

Since the same revision I see similar error:

$ g++ -flto -O2 *.ii 
1.ii:14:3: warning: type ‘struct differential3’ violates the C++ One Definition
Rule [-Wodr]
   14 | } differential3;
      |   ^
2.ii:17:3: note: a different type is defined in another translation unit
   17 | } differential3;
      |   ^
1.ii:12:5: note: the first difference of corresponding definitions is field
‘dx’
   12 |   A dx;
      |     ^
2.ii:15:5: note: a field of same name but different type is defined in another
translation unit
   15 |   A dx;
      |     ^
1.ii:1:33: note: type name ‘A’ should match type name ‘ccl::A’
    1 | struct __attribute__((aligned)) A {};
      |                                 ^
2.ii:2:33: note: the incompatible type is defined here
    2 | struct __attribute__((aligned)) A {
      |                                 ^
1.ii:15:8: warning: type ‘struct C’ violates the C++ One Definition Rule
[-Wodr]
   15 | struct C {
      |        ^
2.ii:18:8: note: a different type is defined in another translation unit
   18 | struct C {
      |        ^
1.ii:16:5: note: the first difference of corresponding definitions is field ‘P’
   16 |   A P;
      |     ^
2.ii:19:5: note: a field of same name but different type is defined in another
translation unit
   19 |   A P;
      |     ^
1.ii:1:33: note: type name ‘A’ should match type name ‘ccl::A’
    1 | struct __attribute__((aligned)) A {};
      |                                 ^
2.ii:2:33: note: the incompatible type is defined here
    2 | struct __attribute__((aligned)) A {
      |                                 ^
1.ii:3:8: warning: type ‘struct B’ violates the C++ One Definition Rule [-Wodr]
    3 | struct B {
      |        ^
2.ii:6:8: note: a different type is defined in another translation unit
    6 | struct B {
      |        ^
1.ii:4:5: note: the first difference of corresponding definitions is field
‘diffuse’
    4 |   A diffuse;
      |     ^
2.ii:7:5: note: a field of same name but different type is defined in another
translation unit
    7 |   A diffuse;
      |     ^
1.ii:1:33: note: type name ‘A’ should match type name ‘ccl::A’
    1 | struct __attribute__((aligned)) A {};
      |                                 ^
2.ii:2:33: note: the incompatible type is defined here
    2 | struct __attribute__((aligned)) A {
      |                                 ^
lto1: error: ‘TYPE_CANONICAL’ is not compatible
 <record_type 0x7fbd73a87498 SubsurfaceIndirectRays cxx-odr-p BLK
    size <integer_cst 0x7fbd73e788d0 type <integer_type 0x7fbd73c950a8
bitsizetype> constant 17664>
    unit-size <integer_cst 0x7fbd73e788a0 type <integer_type 0x7fbd73c95000
sizetype> constant 2208>
    user align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fbd73a87498
    fields <field_decl 0x7fbd73a88a18 state
        type <array_type 0x7fbd73a873f0 type <record_type 0x7fbd73a87348
PathState>
            BLK
            size <integer_cst 0x7fbd73e78780 constant 10368>
            unit-size <integer_cst 0x7fbd73e78768 constant 1296>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1
structural-equality domain <integer_type 0x7fbd73e7db28>>
        nonlocal BLK 1.ii:47:13 size <integer_cst 0x7fbd73e78780 10368>
unit-size <integer_cst 0x7fbd73e78768 1296>
        align:32 warn_if_not_align:0 offset_align 128
        offset <integer_cst 0x7fbd73c80bd0 constant 0>
        bit-offset <integer_cst 0x7fbd73c80c18 constant 0> context <record_type
0x7fbd73a87498 SubsurfaceIndirectRays>
        chain <field_decl 0x7fbd73a88c78 num_rays type <integer_type
0x7fbd73c955e8 int>
            nonlocal SI 1.ii:48:7
            size <integer_cst 0x7fbd73c80de0 constant 32>
            unit-size <integer_cst 0x7fbd73c80df8 constant 4>
            align:32 warn_if_not_align:0 offset_align 128 offset <integer_cst
0x7fbd73e78768 1296> bit-offset <integer_cst 0x7fbd73c80c18 0> context
<record_type 0x7fbd73a87498 SubsurfaceIndirectRays> chain <field_decl
0x7fbd73a88980 rays>>> context <namespace_decl 0x7fbd73a831c8 ccl>>
 <record_type 0x7fbd73a879d8 SubsurfaceIndirectRays cxx-odr-p BLK
    size <integer_cst 0x7fbd73e788d0 type <integer_type 0x7fbd73c950a8
bitsizetype> constant 17664>
    unit-size <integer_cst 0x7fbd73e788a0 type <integer_type 0x7fbd73c95000
sizetype> constant 2208>
    user align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fbd73a87498
    fields <field_decl 0x7fbd73a8a5f0 state
        type <array_type 0x7fbd73a873f0 type <record_type 0x7fbd73a87348
PathState>
            BLK
            size <integer_cst 0x7fbd73e78780 constant 10368>
            unit-size <integer_cst 0x7fbd73e78768 constant 1296>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1
structural-equality domain <integer_type 0x7fbd73e7db28>>
        nonlocal BLK 2.ii:50:13 size <integer_cst 0x7fbd73e78780 10368>
unit-size <integer_cst 0x7fbd73e78768 1296>
        align:32 warn_if_not_align:0 offset_align 128
        offset <integer_cst 0x7fbd73c80bd0 constant 0>
        bit-offset <integer_cst 0x7fbd73c80c18 constant 0> context <record_type
0x7fbd73a879d8 SubsurfaceIndirectRays>
        chain <field_decl 0x7fbd73a8a7b8 num_rays type <integer_type
0x7fbd73c955e8 int>
            nonlocal SI 2.ii:51:7
            size <integer_cst 0x7fbd73c80de0 constant 32>
            unit-size <integer_cst 0x7fbd73c80df8 constant 4>
            align:32 warn_if_not_align:0 offset_align 128 offset <integer_cst
0x7fbd73e78768 1296> bit-offset <integer_cst 0x7fbd73c80c18 0> context
<record_type 0x7fbd73a879d8 SubsurfaceIndirectRays> chain <field_decl
0x7fbd73a8a4c0 rays>>> context <namespace_decl 0x7fbd73a831c8 ccl>
    pointer_to_this <pointer_type 0x7fbd73a87d20>>
lto1: internal compiler error: ‘verify_type’ failed
0xf5a148 verify_type(tree_node const*)
        ../../gcc/tree.c:14775
0x7ec407 lto_fixup_state
        ../../gcc/lto/lto-common.c:2582
0x7f6f84 lto_fixup_decls
        ../../gcc/lto/lto-common.c:2613
0x7f6f84 read_cgraph_and_symbols(unsigned int, char const**)
        ../../gcc/lto/lto-common.c:2848
0x7dd692 lto_main()
        ../../gcc/lto/lto.c:616
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Reply via email to