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

            Bug ID: 117724
           Summary: [15 regression] ICE when building libgit2 (error:
                    ‘TYPE_CANONICAL’ is not compatible)
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-checking
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: uecker at gcc dot gnu.org
  Target Milestone: ---

Created attachment 59657
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59657&action=edit
smart_pkt.i.xz

This built OK on the 17th, so it's not quite a dupe of the other TYPE_CANONICAL
issues AFAIK.

```
$ gcc smart_pkt.i -c -g
In file included from libgit2/src/libgit2/transports/smart_pkt.c:10:
libgit2/src/libgit2/transports/smart.h:175:16: error: ‘TYPE_CANONICAL’ is not
compatible
  175 |         git_staticstr_with_size(GIT_SMART_BUFFER_SIZE) buffer;
      |                ^
 <record_type 0x72e7e6d78690 asm_written includes-flexarray BLK
    size <integer_cst 0x72e7e7402f90 type <integer_type 0x72e7e74230a8
bitsizetype> constant 128>
    unit-size <integer_cst 0x72e7e7402fa8 type <integer_type 0x72e7e7423000
sizetype> constant 16>
    align:64 warn_if_not_align:0 symtab:-422098352 alias-set -1 canonical-type
0x72e7e6d78690
    fields <field_decl 0x72e7e6d71be0 len
        type <integer_type 0x72e7e75e5d20 size_t asm_written public unsigned DI
            size <integer_cst 0x72e7e7402f48 constant 64>
            unit-size <integer_cst 0x72e7e7402f60 constant 8>
            align:64 warn_if_not_align:0 symtab:-413218304 alias-set -1
canonical-type 0x72e7e74237e0 precision:64 min <integer_cst 0x72e7e7425228 0>
max <integer_cst 0x72e7e74036a0 18446744073709551615>
            pointer_to_this <pointer_type 0x72e7e70db930>>
        unsigned DI libgit2/src/util/staticstr.h:14:9 size <integer_cst
0x72e7e7402f48 64> unit-size <integer_cst 0x72e7e7402f60 8>
        align:64 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 1
        offset <integer_cst 0x72e7e7402f78 constant 0>
        bit-offset <integer_cst 0x72e7e7402fc0 constant 0> context <record_type
0x72e7e6d78690>
        chain <field_decl 0x72e7e6d71c78 size type <integer_type 0x72e7e75e5d20
size_t>
            unsigned DI libgit2/src/util/staticstr.h:17:9 size <integer_cst
0x72e7e7402f48 64> unit-size <integer_cst 0x72e7e7402f60 8>
            align:64 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 1
offset <integer_cst 0x72e7e7402f78 0> bit-offset <integer_cst 0x72e7e7402f48
64> context <record_type 0x72e7e6d78690> chain <field_decl 0x72e7e6d71d10
data>>>
    chain <type_decl 0x72e7e6d71b48 D.12863>>
 <record_type 0x72e7e6d8af18 BLK
    size <integer_cst 0x72e7e6d79690 type <integer_type 0x72e7e74230a8
bitsizetype> constant 524416>
    unit-size <integer_cst 0x72e7e6d79660 type <integer_type 0x72e7e7423000
sizetype> constant 65552>
    align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x72e7e6d78690
    fields <field_decl 0x72e7e6d91720 len
        type <integer_type 0x72e7e75e5d20 size_t asm_written public unsigned DI
            size <integer_cst 0x72e7e7402f48 constant 64>
            unit-size <integer_cst 0x72e7e7402f60 constant 8>
            align:64 warn_if_not_align:0 symtab:-413218304 alias-set -1
canonical-type 0x72e7e74237e0 precision:64 min <integer_cst 0x72e7e7425228 0>
max <integer_cst 0x72e7e74036a0 18446744073709551615>
            pointer_to_this <pointer_type 0x72e7e70db930>>
        unsigned DI libgit2/src/libgit2/transports/smart.h:175:18 size
<integer_cst 0x72e7e7402f48 64> unit-size <integer_cst 0x72e7e7402f60 8>
        align:64 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 1
        offset <integer_cst 0x72e7e7402f78 constant 0>
        bit-offset <integer_cst 0x72e7e7402fc0 constant 0> context <record_type
0x72e7e6d8af18>
        chain <field_decl 0x72e7e6d917b8 size type <integer_type 0x72e7e75e5d20
size_t>
            unsigned DI libgit2/src/libgit2/transports/smart.h:175:30 size
<integer_cst 0x72e7e7402f48 64> unit-size <integer_cst 0x72e7e7402f60 8>
            align:64 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 1
offset <integer_cst 0x72e7e7402f78 0> bit-offset <integer_cst 0x72e7e7402f48
64> context <record_type 0x72e7e6d8af18> chain <field_decl 0x72e7e6d91850
data>>>
    chain <type_decl 0x72e7e6d91688 D.12981>>
libgit2/src/libgit2/transports/smart.h:175:16: internal compiler error:
‘verify_type’ failed
0x615648ef2999 internal_error(char const*, ...)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/diagnostic-global-context.cc:518
0x6156476afd8e verify_type(tree_node const*)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/tree.cc:14496
0x6156490f693a gen_type_die_with_usage
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:26351
0x6156490f668a gen_type_die
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:26582
0x6156490a178e gen_decl_die
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:27222
0x61564989e829 dwarf2out_decl
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:27780
0x615649072fdd dwarf2out_type_decl
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:27498
0x6156490e9c89 rest_of_type_compilation(tree_node*, int)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/passes.cc:340
0x6156498eb4f2 finish_struct(unsigned int, tree_node*, tree_node*, tree_node*,
c_struct_parse_info*, tree_node**)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-decl.cc:9910
0x6156490bdd13 c_parser_struct_or_union_specifier
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:4145
0x6156490bdd13 c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool,
bool, bool, bool, bool, c_lookahead_kind)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:3549
0x6156498de70f c_parser_struct_declaration
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:4241
0x6156490bdc3e c_parser_struct_or_union_specifier
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:4119
0x6156490bdc3e c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool,
bool, bool, bool, bool, c_lookahead_kind)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:3549
0x6156498ba793 c_parser_declaration_or_fndef
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:2338
0x6156498ba5b1 c_parser_external_declaration
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:2065
0x6156498b657a c_parser_translation_unit
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:1919
0x6156498b657a c_parse_file()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c/c-parser.cc:28047
0x6156498aadf0 c_common_parse_file()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c-family/c-opts.cc:1375
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

```

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/15/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/15
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/15/python
--enable-objc-gc --enable-languages=c,c++,d,go,objc,obj-c++,fortran,ada,m2,rust
--enable-obsolete --enable-secureplt --disable-werror --with-system-zlib
--enable-nls --without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 15.0.9999 p, commit
aa56b526fa7d8766f57a7f24bedde612b00c197d' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point
--enable-targets=all --enable-libgomp --disable-libssp --enable-libada
--disable-cet --disable-systemtap --enable-valgrind-annotations
--disable-vtable-verify --disable-libvtv --with-zstd --with-isl
--disable-isl-version-check --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20241120 (experimental)
7c7da1036509a988b9ca3492eb856081132b14b2 (Gentoo Hardened 15.0.9999 p, commit
aa56b526fa7d8766f57a7f24bedde612b00c197d)
```

Reply via email to