diff options
author | Andrew Pinski <apinski@cavium.com> | 2011-11-30 19:55:36 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2011-11-30 11:55:36 -0800 |
commit | 9abfe98649d444d324f707d25071bcd8f31282e8 (patch) | |
tree | e77352b3962f65cd032090753790f973b56f0f82 /gcc/c-parser.c | |
parent | 9790c19e52e65814d6c738fe0e31e25e93f3f4cb (diff) | |
download | gcc-9abfe98649d444d324f707d25071bcd8f31282e8.tar.gz |
re PR c/51321 (__builtin_types_compatible_p (any_type_t[1][], any_other_type_t) crashes GCC)
2011-11-30 Andrew Pinski <apinski@cavium.com>
PR c/51321
* c-parser.c (c_parser_postfix_expression): Check groktypename results
before looking at the main variant.
2011-11-30 Andrew Pinski <apinski@cavium.com>
* gcc.dg/pr51321.c: New testcase.
From-SVN: r181857
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index b88b11fc430..e227137bfb0 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -6568,9 +6568,16 @@ c_parser_postfix_expression (c_parser *parser) "expected %<)%>"); { tree e1, e2; + e1 = groktypename (t1, NULL, NULL); + e2 = groktypename (t2, NULL, NULL); + if (e1 == error_mark_node || e2 == error_mark_node) + { + expr.value = error_mark_node; + break; + } - e1 = TYPE_MAIN_VARIANT (groktypename (t1, NULL, NULL)); - e2 = TYPE_MAIN_VARIANT (groktypename (t2, NULL, NULL)); + e1 = TYPE_MAIN_VARIANT (e1); + e2 = TYPE_MAIN_VARIANT (e2); expr.value = comptypes (e1, e2) ? integer_one_node : integer_zero_node; |