[Bug c++/106848] New: ICE when compiling module interface file with -g: error: type variant differs by TYPE_MAX_VALUE

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 6 13:40:43 GMT 2022


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

            Bug ID: 106848
           Summary: ICE when compiling module interface file with -g:
                    error: type variant differs by TYPE_MAX_VALUE
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
            Blocks: 103524
  Target Milestone: ---

$ cat std.cc
export module std;

import <bits/stdc++.h>;


Compiling the bits/stdc++.h works OK:

$ gcc -c -std=c++23 -fmodules-ts -x c++-system-header bits/stdc++.h


And compiling the module file works without -g:

$ ~/gcc/13/bin/gcc -c -std=c++23 -fmodules-ts std.cc


But with -g there's an ICE:

$ ~/gcc/13/bin/gcc -c -std=c++23 -fmodules-ts std.cc -g
std.cc:3:24: error: type variant differs by TYPE_MAX_VALUE
    3 | import <bits/stdc++.h>;
      |                        ^
 <enumeral_type 0x7feb36b08bd0 _TokenT
    type <integer_type 0x7feb3950e690 unsigned int asm_written public unsigned
type_6 SI
        size <integer_cst 0x7feb395101b0 constant 32>
        unit-size <integer_cst 0x7feb395101c8 constant 4>
        align:32 warn_if_not_align:0 symtab:931886976 alias-set -1
canonical-type 0x7feb3950e690 precision:32 min <integer_cst 0x7feb395101e0 0>
max <integer_cst 0x7feb39510198 4294967295>
        pointer_to_this <pointer_type 0x7feb39520540> reference_to_this
<reference_type 0x7feb35b1a7e0>>
    asm_written unsigned type_5 type_6 SI size <integer_cst 0x7feb395101b0 32>
unit-size <integer_cst 0x7feb395101c8 4>
    align:32 warn_if_not_align:0 symtab:877031008 alias-set -1 canonical-type
0x7feb36b08bd0 precision:32 min <integer_cst 0x7feb395101e0 0> max <integer_cst
0x7feb39510198 4294967295>
    values <tree_list 0x7feb3446b028
        purpose <identifier_node 0x7feb3445f2c0 _S_token_anychar
            normal local bindings <(nil)>>
        value <const_decl 0x7feb3494fc40 _S_token_anychar type <enumeral_type
0x7feb36b08bd0 _TokenT>
            readonly constant nonlocal VOID
/home/jwakely/gcc/13/include/c++/13.0.0/bits/regex_scanner.h:48:7
            align:1 warn_if_not_align:0 context <enumeral_type 0x7feb36b08bd0
_TokenT> initial <integer_cst 0x7feb3444f618 0> chain <const_decl
0x7feb3494fcb0 _S_token_ord_char>>
        chain <tree_list 0x7feb3446b050
            purpose <identifier_node 0x7feb3445f300 _S_token_ord_char
                normal local bindings <(nil)>> value <const_decl 0x7feb3494fcb0
_S_token_ord_char>
            chain <tree_list 0x7feb3446b078
                purpose <identifier_node 0x7feb3445f340 _S_token_oct_num
                    normal local bindings <(nil)>> value <const_decl
0x7feb3494fd20 _S_token_oct_num>
                chain <tree_list 0x7feb3446b0a0
                    purpose <identifier_node 0x7feb3445f380 _S_token_hex_num
                        normal local bindings <(nil)>> value <const_decl
0x7feb3494fd90 _S_token_hex_num>
                    chain <tree_list 0x7feb3446b0c8
                        purpose <identifier_node 0x7feb3445f3c0
_S_token_backref
                            normal local bindings <(nil)>> value <const_decl
0x7feb3494fe00 _S_token_backref>
                        chain <tree_list 0x7feb3446b0f0 purpose
<identifier_node 0x7feb3445f400 _S_token_subexpr_begin> value <const_decl
0x7feb3494fe70 _S_token_subexpr_begin> chain <tree_list 0x7feb3446b118>>>>>>>
context <record_type 0x7feb36b08b28 _ScannerBase>
    chain <type_decl 0x7feb36b00ab0 _TokenT>>
 <enumeral_type 0x7feb35f18540 _TokenT
    type <integer_type 0x7feb3950e690 unsigned int asm_written public unsigned
type_6 SI
        size <integer_cst 0x7feb395101b0 constant 32>
        unit-size <integer_cst 0x7feb395101c8 constant 4>
        align:32 warn_if_not_align:0 symtab:931886976 alias-set -1
canonical-type 0x7feb3950e690 precision:32 min <integer_cst 0x7feb395101e0 0>
max <integer_cst 0x7feb39510198 4294967295>
        pointer_to_this <pointer_type 0x7feb39520540> reference_to_this
<reference_type 0x7feb35b1a7e0>>
    readonly unsigned type_5 type_6 SI size <integer_cst 0x7feb395101b0 32>
unit-size <integer_cst 0x7feb395101c8 4>
    align:32 warn_if_not_align:0 symtab:877078960 alias-set -1 canonical-type
0x7feb35f18540 precision:32 context <record_type 0x7feb36b08b28 _ScannerBase>
reference_to_this <reference_type 0x7feb35f185e8>>
std.cc:3:24: internal compiler error: ‘verify_type’ failed
0x149aade verify_type(tree_node const*)
        /home/jwakely/src/gcc/gcc/gcc/tree.cc:14023
0xd936f3 gen_type_die_with_usage
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26117
0xd93a0b gen_type_die_with_usage
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26251
0xda82b3 gen_type_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26348
0xda82b3 gen_formal_types_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:23083
0xd8cf96 gen_subprogram_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:23927
0xd90919 gen_decl_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26964
0xd92bb5 gen_member_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:25801
0xd92bb5 gen_struct_or_union_type_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:25897
0xd92bb5 gen_tagged_type_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26098
0xd939d0 gen_tagged_type_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26052
0xd939d0 gen_type_die_with_usage
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26293
0xd9052b gen_type_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26348
0xd9052b gen_decl_die
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:26987
0xd916db dwarf2out_decl
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:27542
0xd919d8 dwarf2out_type_decl
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:27260
0xd919d8 dwarf2out_type_decl
        /home/jwakely/src/gcc/gcc/gcc/dwarf2out.cc:27255
0x10b94e4 rest_of_type_compilation(tree_node*, int)
        /home/jwakely/src/gcc/gcc/gcc/passes.cc:339
0xaa7fc5 trees_in::read_class_def(tree_node*, tree_node*)
        /home/jwakely/src/gcc/gcc/gcc/cp/module.cc:12173
0xaa9b59 module_state::read_cluster(unsigned int)
        /home/jwakely/src/gcc/gcc/gcc/cp/module.cc:14957
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524
[Bug 103524] [meta-bug] modules issue


More information about the Gcc-bugs mailing list