[llvm-commits] [llvm-gcc-4-2] r39948 - in /llvm-gcc-4-2/trunk/gcc: fold-const.c gimplify.c

Chris Lattner clattner at apple.com
Mon Jul 16 18:11:34 PDT 2007


> Log:
> Fix null dereference and an obvious syntax error when llvm is not
> enabled...

> --- llvm-gcc-4-2/trunk/gcc/gimplify.c (original)
> +++ llvm-gcc-4-2/trunk/gcc/gimplify.c Mon Jul 16 20:01:43 2007
> @@ -179,8 +179,10 @@
>    /* LLVM LOCAL begin */
>  #ifndef ENABLE_LLVM
>    /* LLVM wants to know about gimple formal temps. */
> -  for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
> -    DECL_GIMPLE_FORMAL_TEMP_P (t) = 0;
> +  if (gimplify_ctxp != 0) {
> +    for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
> +      DECL_GIMPLE_FORMAL_TEMP_P (t) = 0;
> +  }
>  #else
>    t = 0;
>  #endif

Hey Scott,

Doesn't this patch change the behavior of the code when LLVM is *not*  
enabled?   What am I missing here?  Should the #ifndef ENABLE_LLVM  
really be #ifdef ENABLE_LLVM ?

-Chris



More information about the llvm-commits mailing list