This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix C/51321, ICE With incomplete types with __builtin_types_compatible_p
- From: Andrew Pinski <andrew dot pinski at caviumnetworks dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 30 Nov 2011 11:23:22 -0800
- Subject: [PATCH] Fix C/51321, ICE With incomplete types with __builtin_types_compatible_p
Hi,
The problem here is that right after groktypename we take the
TYPE_MAIN_VARIANT of the result which is incorrect. There needs a
check for error_mark_node. This adds the obvious check and fixes the
ICE.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
Thanks,
Andrew Pinski
ChangeLog:
* c-parser.c (c_parser_postfix_expression): Check groktypename results
before looking at the main variant.
testsuite/ChangeLog:
* testsuite/gcc.dg/pr51321.c: New testcase