]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/16216 (ICE in gimplify_va_arg_expr after error)
authorRichard Henderson <rth@redhat.com>
Tue, 29 Jun 2004 23:10:53 +0000 (16:10 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 29 Jun 2004 23:10:53 +0000 (16:10 -0700)
        PR middle-end/16216
        * builtins.c (gimplify_va_arg_expr): Check for valist being
        an error_mark_node.

From-SVN: r83881

gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/gcc.dg/noncompile/20040629-1.c [new file with mode: 0644]

index be03295f9c6bda37c9c55dbfc4ddeeff82aed74e..a8fe360880130dab7a87dda1f91b4cbaf82f47ec 100644 (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
index 92a4dc3b2f7e3f8fc6310e286ae709031d4de2a1..74c1f98c69f729afbe9871ee3a243e3da6410faf 100644 (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
diff --git a/gcc/testsuite/gcc.dg/noncompile/20040629-1.c b/gcc/testsuite/gcc.dg/noncompile/20040629-1.c
new file mode 100644 (file)
index 0000000..3575b83
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR 16216 */
+
+void func()
+{
+        const char *pek; int i;
+        pek=__builtin_va_arg(ap,const char*);  /* { dg-error "" } */
+}