[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

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 14 12:25:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70651

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
And we seem to do the right thing if I just do away with the canon_expr_type:

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 30c815d..8b0a34b 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5722,11 +5722,6 @@ build_va_arg (location_t loc, tree expr, tree 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));
-      gcc_assert (canon_expr_type != NULL_TREE);
-
       return build_va_arg_1 (loc, type, expr);
     }


(there are two spots like that)


More information about the Gcc-bugs mailing list