aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r--gcc/c-family/c-common.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 9a66cfe..16f6548 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5864,20 +5864,11 @@ build_va_arg (location_t loc, tree expr, tree type)
{
/* Case 1: Not an array type. */
- /* Take the address, to get '&ap'. */
+ /* Take the address, to get '&ap'. Note that &ap is not a va_list
+ type. */
mark_addressable (expr);
expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (expr)), expr);
- /* Verify that &ap is still recognized as having va_list type. */
- tree canon_expr_type
- = targetm.canonical_va_list_type (TREE_TYPE (expr));
- if (canon_expr_type == NULL_TREE)
- {
- error_at (loc,
- "first argument to %<va_arg%> not of type %<va_list%>");
- return error_mark_node;
- }
-
return build_va_arg_1 (loc, type, expr);
}
@@ -5944,12 +5935,7 @@ build_va_arg (location_t loc, tree expr, tree type)
/* Verify that &ap is still recognized as having va_list type. */
tree canon_expr_type
= targetm.canonical_va_list_type (TREE_TYPE (expr));
- if (canon_expr_type == NULL_TREE)
- {
- error_at (loc,
- "first argument to %<va_arg%> not of type %<va_list%>");
- return error_mark_node;
- }
+ gcc_assert (canon_expr_type != NULL_TREE);
}
else
{