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

            Bug ID: 117622
           Summary: [14/15 regression] builtin-sprintf-warn-1.c test fails
                    with -std=gnu23 -g (error: ‘TYPE_CANONICAL’ is not
                    compatible)
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: testsuite-fail
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

-std=gnu23 is now the default but with a slightly older trunk build w/ explicit
-std=gnu23:
```
$ gcc gcc.dg/tree-ssa/builtin-sprintf-warn-1.c -g -c -std=gnu23
[...]
gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: In function
‘test_sprintf_zero_length_array’:
gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:1740:1: error: ‘TYPE_CANONICAL’ is not
compatible
 1740 | }
      | ^
 <record_type 0x73bb901f83f0 S includes-flexarray BLK
    size <integer_cst 0x73bb90024198 type <integer_type 0x73bb900220a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x73bb900241b0 type <integer_type 0x73bb90022000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x73bb901f83f0
    fields <field_decl 0x73bb90031980 n
        type <integer_type 0x73bb900225e8 int sizes-gimplified asm_written
public SI size <integer_cst 0x73bb90024198 32> unit-size <integer_cst
0x73bb900241b0 4>
            align:32 warn_if_not_align:0 symtab:-1877081872 alias-set -1
canonical-type 0x73bb900225e8 precision:32 min <integer_cst 0x73bb90024150
-2147483648> max <integer_cst 0x73bb90024168 2147483647>
            pointer_to_this <pointer_type 0x73bb9002ab28>>
        SI gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:141:9 size <integer_cst
0x73bb90024198 32> unit-size <integer_cst 0x73bb900241b0 4>
        align:32 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 1
        offset <integer_cst 0x73bb90002f78 constant 0>
        bit-offset <integer_cst 0x73bb90002fc0 constant 0> context <record_type
0x73bb901f83f0 S>
        chain <field_decl 0x73bb90031a18 a type <array_type 0x73bb901f8540>
            BLK gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:142:10
            align:8 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 0
offset <integer_cst 0x73bb90002f78 0> bit-offset <integer_cst 0x73bb90024198
32> context <record_type 0x73bb901f83f0 S>>> context <function_decl
0x73bb901f5300 test_sprintf_flexarray>
    pointer_to_this <pointer_type 0x73bb901f8348> chain <type_decl
0x73bb900318e8 D.2869>>
gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:1740:1: error: ‘TYPE_MODE’ of
‘TYPE_CANONICAL’ is not compatible
 <record_type 0x73bb901f83f0 S includes-flexarray BLK
    size <integer_cst 0x73bb90024198 type <integer_type 0x73bb900220a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x73bb900241b0 type <integer_type 0x73bb90022000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x73bb901f83f0
    fields <field_decl 0x73bb90031980 n
        type <integer_type 0x73bb900225e8 int sizes-gimplified asm_written
public SI size <integer_cst 0x73bb90024198 32> unit-size <integer_cst
0x73bb900241b0 4>
            align:32 warn_if_not_align:0 symtab:-1877081872 alias-set -1
canonical-type 0x73bb900225e8 precision:32 min <integer_cst 0x73bb90024150
-2147483648> max <integer_cst 0x73bb90024168 2147483647>
            pointer_to_this <pointer_type 0x73bb9002ab28>>
        SI gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:141:9 size <integer_cst
0x73bb90024198 32> unit-size <integer_cst 0x73bb900241b0 4>
        align:32 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 1
        offset <integer_cst 0x73bb90002f78 constant 0>
        bit-offset <integer_cst 0x73bb90002fc0 constant 0> context <record_type
0x73bb901f83f0 S>
        chain <field_decl 0x73bb90031a18 a type <array_type 0x73bb901f8540>
            BLK gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:142:10
            align:8 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 0
offset <integer_cst 0x73bb90002f78 0> bit-offset <integer_cst 0x73bb90024198
32> context <record_type 0x73bb901f83f0 S>>> context <function_decl
0x73bb901f5300 test_sprintf_flexarray>
    pointer_to_this <pointer_type 0x73bb901f8348> chain <type_decl
0x73bb900318e8 D.2869>>
 <record_type 0x73bb901f8f18 S SI
    size <integer_cst 0x73bb90024198 type <integer_type 0x73bb900220a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x73bb900241b0 type <integer_type 0x73bb90022000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x73bb901f83f0
    fields <field_decl 0x73bb90031b48 n
        type <integer_type 0x73bb900225e8 int sizes-gimplified asm_written
public SI size <integer_cst 0x73bb90024198 32> unit-size <integer_cst
0x73bb900241b0 4>
            align:32 warn_if_not_align:0 symtab:-1877081872 alias-set -1
canonical-type 0x73bb900225e8 precision:32 min <integer_cst 0x73bb90024150
-2147483648> max <integer_cst 0x73bb90024168 2147483647>
            pointer_to_this <pointer_type 0x73bb9002ab28>>
        SI gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:165:9 size <integer_cst
0x73bb90024198 32> unit-size <integer_cst 0x73bb900241b0 4>
        align:32 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 1
        offset <integer_cst 0x73bb90002f78 constant 0>
        bit-offset <integer_cst 0x73bb90002fc0 constant 0> context <record_type
0x73bb901f8f18 S>
        chain <field_decl 0x73bb90031be0 a type <array_type 0x73bb901ff150>
            BLK gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:166:10 size
<integer_cst 0x73bb90002fc0 0> unit-size <integer_cst 0x73bb90002f78 0>
            align:8 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 0
offset <integer_cst 0x73bb90002f78 0> bit-offset <integer_cst 0x73bb90024198
32> context <record_type 0x73bb901f8f18 S>>> context <function_decl
0x73bb901f5500 test_sprintf_zero_length_array>
    pointer_to_this <pointer_type 0x73bb901ff1f8> chain <type_decl
0x73bb90031ab0 D.2877>>
gcc.dg/tree-ssa/builtin-sprintf-warn-1.c:1740:1: internal compiler error:
‘verify_type’ failed
0x61e44e479b27 internal_error(char const*, ...)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/diagnostic-global-context.cc:518
0x61e44cc38b3c verify_type(tree_node const*)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/tree.cc:14491
0x61e44e66d08a gen_type_die_with_usage
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:26351
0x61e44e66c70a gen_type_die
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:26582
0x61e44e6226ae gen_decl_die
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:27222
0x61e44e85c485 decls_for_scope
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:26762
0x61e44e668a73 gen_subprogram_die
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:24234
0x61e44e622817 gen_decl_die
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:27199
0x61e44edf4569 dwarf2out_decl
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:27780
0x61e44e65e4d4 dwarf2out_early_global_decl
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/dwarf2out.cc:27421
0x61e44e6f171d c_common_finalize_early_debug()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c-family/c-common.cc:10160
0x61e44ee4e02c symbol_table::finalize_compilation_unit()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cgraphunit.cc:2580
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.
```

Reply via email to