This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70651] [6 Regression] ICE on valid code on x86_64-linux-gnu in build_va_arg, at c-family/c-common.c:5728
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Apr 2016 12:03:32 +0000
- Subject: [Bug c/70651] [6 Regression] ICE on valid code on x86_64-linux-gnu in build_va_arg, at c-family/c-common.c:5728
- Auto-submitted: auto-generated
- References: <bug-70651-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70651
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I'm testing this:
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5725,7 +5725,12 @@ 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));
- gcc_assert (canon_expr_type != NULL_TREE);
+ 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);
}
@@ -5793,7 +5798,12 @@ 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));
- gcc_assert (canon_expr_type != NULL_TREE);
+ if (canon_expr_type == NULL_TREE)
+ {
+ error_at (loc,
+ "first argument to %<va_arg%> not of type %<va_list%>");
+ return error_mark_node;
+ }
}
else
{