re PR middle-end/16216 (ICE in gimplify_va_arg_expr after error)

PR middle-end/16216
        * builtins.c (gimplify_va_arg_expr): Check for valist being
        an error_mark_node.

From-SVN: r83881
This commit is contained in:
Richard Henderson 2004-06-29 16:10:53 -07:00 committed by Richard Henderson
parent beabab5904
commit 97bb4af77a
3 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2004-06-29 Richard Henderson <rth@redhat.com>
PR middle-end/16216
* builtins.c (gimplify_va_arg_expr): Check for valist being
an error_mark_node.
2004-06-29 Jakub Jelinek <jakub@redhat.com>
PR target/16195

View File

@ -4466,9 +4466,12 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p)
tree t;
/* Verify that valist is of the proper type. */
want_va_type = va_list_type_node;
have_va_type = TREE_TYPE (valist);
if (have_va_type == error_mark_node)
return GS_ERROR;
if (TREE_CODE (want_va_type) == ARRAY_TYPE)
{
/* If va_list is an array type, the argument may have decayed

View File

@ -0,0 +1,7 @@
/* PR 16216 */
void func()
{
const char *pek; int i;
pek=__builtin_va_arg(ap,const char*); /* { dg-error "" } */
}