[Bug c/125694] 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
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 10 20:45:53 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125694
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:d172a9666d4281355786062dcc958a64e28a292c
commit r17-1480-gd172a9666d4281355786062dcc958a64e28a292c
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Jun 10 22:44:22 2026 +0200
c, c++: Fix __builtin_{bswap,bitreverse}g error recovery [PR125694]
The following invalid testcases ICE in both the C and C++ FEs.
If arg is error_mark_node, TREE_TYPE works on it (and gives
error_mark_node)
but TYPE_MAIN_VARIANT on it is already invalid.
The following patch fixes it in both spot by checking for error_operand_p
before that.
2026-06-10 Jakub Jelinek <jakub@redhat.com>
PR c/125694
* c-parser.cc (c_parser_postfix_expression): If arg is
error_operand_p, set error and break.
* typeck.cc (build_x_bswapg_bitreverseg ): If arg is
error_operand_p,
return error_mark_node.
* c-c++-common/builtin-bswapg-5.c: New test.
* c-c++-common/builtin-bitreverseg-4.c: New test.
Reviewed-by: Joseph Myers <josmyers@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
More information about the Gcc-bugs
mailing list