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

            Bug ID: 123856
           Summary: [15/16 Regression] ICE: in c_type_tag, at
                    c/c-typeck.cc:609 with -W and hardbool
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: diagnostic, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 63508
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63508&action=edit
reduced testcase

Compiler output:
$ gcc -W testcase.c 
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in c_type_tag, at c/c-typeck.cc:617
    4 | void foo() { bar(b); }
      | ^~~~
0x2c97dbd internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0xe2b7bd fancy_abort(char const*, int, char const*)
        /repo/gcc-trunk/gcc/diagnostics/context.cc:1812
0x75c5ea c_type_tag(tree_node const*)
        /repo/gcc-trunk/gcc/c/c-typeck.cc:617
0xe701c0 tagged_types_tu_compatible_p
        /repo/gcc-trunk/gcc/c/c-typeck.cc:1854
0xe701c0 comptypes_internal
        /repo/gcc-trunk/gcc/c/c-typeck.cc:1779
0xe7111b comptypes(tree_node*, tree_node*)
        /repo/gcc-trunk/gcc/c/c-typeck.cc:1506
0xe72f5e convert_for_assignment
        /repo/gcc-trunk/gcc/c/c-typeck.cc:8465
0xe8b2e3 convert_arguments
        /repo/gcc-trunk/gcc/c/c-typeck.cc:4855
0xe8b2e3 build_function_call_vec(unsigned long, vec<unsigned long, va_heap,
vl_ptr>, tree_node*, vec<tree_node*, va_gc, vl_embed>*, vec<tree_node*, va_gc,
vl_embed>*, tree_node*)
        /repo/gcc-trunk/gcc/c/c-typeck.cc:4322
0xec0432 c_parser_postfix_expression_after_primary
        /repo/gcc-trunk/gcc/c/c-parser.cc:14086
0xeaa9e3 c_parser_postfix_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:13636
0xeb616a c_parser_unary_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:10831
0xeb845b c_parser_cast_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:10635
0xeb884f c_parser_binary_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:10403
0xeb9e63 c_parser_conditional_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:10098
0xeba694 c_parser_expr_no_commas
        /repo/gcc-trunk/gcc/c/c-parser.cc:10011
0xebaaf7 c_parser_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:14246
0xebb327 c_parser_expression_conv
        /repo/gcc-trunk/gcc/c/c-parser.cc:14305
0xee3c9f c_parser_statement_after_labels
        /repo/gcc-trunk/gcc/c/c-parser.cc:8546
0xeec4a6 c_parser_compound_statement_nostart
        /repo/gcc-trunk/gcc/c/c-parser.cc:7947
/repo/gcc-trunk/binary-trunk-20260127192034-r16-7075-gfe050fa9d1249a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-20260127192034-r16-7075-gfe050fa9d1249a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/16.0.1/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -Wextra -o /tmp/cc7hTyKv.s
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.

gcc-14 does not ICE, but it gives garbled diagnostics:
$ gcc-14 -W testcase.c -S
'integer_type' not supported by id_expression'}'A' {aka 'enum'integer_type' not
supported by id_expression'}testcase.c: In function 'foo':
testcase.c:4:18: warning: implicit conversion from  to  [-Wenum-conversion]
    4 | void foo() { bar(b); }
      |                  ^


$ gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20260127192034-r16-7075-gfe050fa9d1249a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20260127192034-r16-7075-gfe050fa9d1249a-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260127 (experimental) (GCC)

Reply via email to