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

            Bug ID: 125694
           Summary: ICE: tree check: expected class 'type', have
                    'exceptional' (error_mark) in
                    c_parser_postfix_expression, at c/c-parser.cc:13567 on
                    error inside __builtin_bswapg/__builtin_bitreverseg
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c 
testcase.c: In function 'foo':
testcase.c:4:20: error: wrong number of arguments to '__builtin_bitreverseg'
    4 |   __builtin_bswapg(__builtin_bitreverseg());
      |                    ^~~~~~~~~~~~~~~~~~~~~
testcase.c:4:3: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in c_parser_postfix_expression, at
c/c-parser.cc:13567
    4 |   __builtin_bswapg(__builtin_bitreverseg());
      |   ^~~~~~~~~~~~~~~~
0x2d278bd internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x934f5a tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /repo/gcc-trunk/gcc/tree.cc:9269
0xeb159e tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /repo/gcc-trunk/gcc/tree.h:3947
0xec1610 c_parser_postfix_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:13567
0xeca1fa c_parser_unary_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:10856
0xecc50b c_parser_cast_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:10656
0xecc8fe c_parser_binary_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:10420
0xece003 c_parser_conditional_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:10110
0xece834 c_parser_expr_no_commas
        /repo/gcc-trunk/gcc/c/c-parser.cc:10023
0xecec97 c_parser_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:14324
0xecf4c7 c_parser_expression_conv
        /repo/gcc-trunk/gcc/c/c-parser.cc:14383
0xef833f c_parser_statement_after_labels
        /repo/gcc-trunk/gcc/c/c-parser.cc:8558
0xf00b46 c_parser_compound_statement_nostart
        /repo/gcc-trunk/gcc/c/c-parser.cc:7958
0xf00dc7 c_parser_compound_statement
        /repo/gcc-trunk/gcc/c/c-parser.cc:7172
0xef7beb c_parser_declaration_or_fndef
        /repo/gcc-trunk/gcc/c/c-parser.cc:3354
0xf063cb c_parser_external_declaration
        /repo/gcc-trunk/gcc/c/c-parser.cc:2256
0xf07278 c_parser_translation_unit
        /repo/gcc-trunk/gcc/c/c-parser.cc:2095
0xf07278 c_parse_file()
        /repo/gcc-trunk/gcc/c/c-parser.cc:31480
0xf8d3f1 c_common_parse_file()
        /repo/gcc-trunk/gcc/c-family/c-opts.cc:1430
/repo/gcc-trunk/binary-trunk-20260609070036-gcf6fe3baf82-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-20260609070036-gcf6fe3baf82-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -o /tmp/ccCdtJGg.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.

Reply via email to