This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix pr 16216


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

Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.342
diff -c -p -d -r1.342 builtins.c
*** builtins.c	20 Jun 2004 17:03:02 -0000	1.342
--- builtins.c	29 Jun 2004 23:08:45 -0000
*************** gimplify_va_arg_expr (tree *expr_p, tree
*** 4466,4474 ****
    tree t;
  
    /* Verify that valist is of the proper type.  */
- 
    want_va_type = va_list_type_node;
    have_va_type = TREE_TYPE (valist);
    if (TREE_CODE (want_va_type) == ARRAY_TYPE)
      {
        /* If va_list is an array type, the argument may have decayed
--- 4466,4477 ----
    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
Index: testsuite/gcc.dg/noncompile/20040629-1.c
===================================================================
RCS file: testsuite/gcc.dg/noncompile/20040629-1.c
diff -N testsuite/gcc.dg/noncompile/20040629-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.dg/noncompile/20040629-1.c	29 Jun 2004 23:08:45 -0000
***************
*** 0 ****
--- 1,7 ----
+ /* PR 16216 */
+ 
+ void func()
+ {
+         const char *pek; int i;
+         pek=__builtin_va_arg(ap,const char*);	/* { dg-error "" } */
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]