[Bug c/101312] New: ICE with -g: ‘verify_type’ failed, verify_type(tree_node const*), gen_type_die_with_usage

cnsun at uwaterloo dot ca gcc-bugzilla@gcc.gnu.org
Sun Jul 4 05:45:26 GMT 2021


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

            Bug ID: 101312
           Summary: ICE with -g: ‘verify_type’ failed,
                    verify_type(tree_node const*), gen_type_die_with_usage
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210704 (experimental) [master revision
:03198a1af:e6f3adc899aa9c4d925406974b446634e0db9cd2] (GCC)

$ cat mutant.c
const b[] __attribute__((may_alias));

$ gcc-trunk -w -g mutant.c
mutant.c:1:1: error: ‘TYPE_CANONICAL’ of main variant is not main variant
    1 | const b[] __attribute__((may_alias));
      | ^~~~~
 <array_type 0x7f7f47b4df18
    type <integer_type 0x7f7f47b4de70 int readonly SI
        size <integer_cst 0x7f7f47a19f30 constant 32>
        unit-size <integer_cst 0x7f7f47a19f48 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f7f47b4de70 precision:32 min <integer_cst 0x7f7f47a19ee8 -2147483648> max
<integer_cst 0x7f7f47a19f00 2147483647>>
    BLK
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f7f47b4df18>
 <array_type 0x7f7f47b4ddc8
    type <integer_type 0x7f7f47a325e8 int public SI
        size <integer_cst 0x7f7f47a19f30 constant 32>
        unit-size <integer_cst 0x7f7f47a19f48 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f7f47a325e8 precision:32 min <integer_cst 0x7f7f47a19ee8 -2147483648> max
<integer_cst 0x7f7f47a19f00 2147483647>
        pointer_to_this <pointer_type 0x7f7f47a3a9d8>>
    BLK
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f7f47b4ddc8>
 <array_type 0x7f7f47b4d3f0
    type <integer_type 0x7f7f47b4de70 int readonly SI
        size <integer_cst 0x7f7f47a19f30 constant 32>
        unit-size <integer_cst 0x7f7f47a19f48 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f7f47b4de70 precision:32 min <integer_cst 0x7f7f47a19ee8 -2147483648> max
<integer_cst 0x7f7f47a19f00 2147483647>>
    BLK
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f7f47b4df18
    attributes <tree_list 0x7f7f47b4b938
        purpose <identifier_node 0x7f7f47b631e0 may_alias>>>
mutant.c:1:1: internal compiler error: ‘verify_type’ failed
0x1243008 verify_type(tree_node const*)
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/tree.c:13796
0xb20ac4 gen_type_die_with_usage
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/dwarf2out.c:25960
0xb22826 gen_type_die
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/dwarf2out.c:26191
0xb3bdfb gen_decl_die
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/dwarf2out.c:26869
0xb3cdc6 dwarf2out_decl
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/dwarf2out.c:27385
0xb3cff0 dwarf2out_early_global_decl
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/dwarf2out.c:27035
0x8f639b finish_decl(tree_node*, unsigned int, tree_node*, tree_node*,
tree_node*)
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/c/c-decl.c:5537
0x95a52b c_parser_declaration_or_fndef
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/c/c-parser.c:2370
0x962f93 c_parser_external_declaration
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/c/c-parser.c:1777
0x9639f9 c_parser_translation_unit
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/c/c-parser.c:1650
0x9639f9 c_parse_file()
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/c/c-parser.c:22121
0x9c5a95 c_common_parse_file()
        /tmp/tmp.KJbG2ovrlV-gcc-builder/gcc/gcc/c-family/c-opts.c:1219
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.


More information about the Gcc-bugs mailing list