[PATCH] Fix PR36997

Richard Guenther rguenther@suse.de
Fri Aug 1 13:11:00 GMT 2008


This fixes PR36997, an ICE on invalid code where the gimplifier is
confused by gimplify_call_expr inserting NULL_TREE in the error case.

The fix is to simply use error_mark_node in that case as we already
have to deal with that coming from the frontends.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2008-08-01  Richard Guenther  <rguenther@suse.de>

	PR middle-end/36997
	* gimplify.c (gimplify_call_expr): Set error_mark_node on GS_ERROR.

	* gcc.dg/pr36997.c: New testcase.

Index: gcc/gimplify.c
===================================================================
*** gcc/gimplify.c	(revision 138511)
--- gcc/gimplify.c	(working copy)
*************** gimplify_call_expr (tree *expr_p, gimple
*** 2465,2471 ****
      }
    else
      {
!       *expr_p = NULL_TREE;
        return GS_ERROR;
      }
  
--- 2465,2471 ----
      }
    else
      {
!       *expr_p = error_mark_node;
        return GS_ERROR;
      }
  
Index: gcc/testsuite/gcc.dg/pr36997.c
===================================================================
*** gcc/testsuite/gcc.dg/pr36997.c	(revision 0)
--- gcc/testsuite/gcc.dg/pr36997.c	(revision 0)
***************
*** 0 ****
--- 1,8 ----
+ /* { dg-do compile { target x86_64-*-* i?86-*-* } } */
+ /* { dg-options "-std=c99" } */
+ 
+ typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
+ __m64 _mm_add_si64 (__m64 __m1, __m64 __m2)
+ {
+     return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); /* { dg-error "incompatible type" } */
+ }



More information about the Gcc-patches mailing list