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

Scott Michel scottm at aero.org
Mon Jul 16 18:01:43 PDT 2007


Author: pingbak
Date: Mon Jul 16 20:01:43 2007
New Revision: 39948

URL: http://llvm.org/viewvc/llvm-project?rev=39948&view=rev
Log:
Fix null dereference and an obvious syntax error when llvm is not
enabled...

Modified:
    llvm-gcc-4-2/trunk/gcc/fold-const.c
    llvm-gcc-4-2/trunk/gcc/gimplify.c

Modified: llvm-gcc-4-2/trunk/gcc/fold-const.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/fold-const.c?rev=39948&r1=39947&r2=39948&view=diff

==============================================================================
--- llvm-gcc-4-2/trunk/gcc/fold-const.c (original)
+++ llvm-gcc-4-2/trunk/gcc/fold-const.c Mon Jul 16 20:01:43 2007
@@ -12942,11 +12942,11 @@
 {
   if ((TREE_CODE (exp) == INDIRECT_REF
        || TREE_CODE (exp) == ARRAY_REF)
-      && TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE &&
+      && TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE
 /* LLVM LOCAL begin */      
 #if ENABLE_LLVM
     /* LLVM extends ARRAY_REF to allow pointers to be the base value. */
-      (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == ARRAY_TYPE)
+      && (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == ARRAY_TYPE)
 #endif
 /* LLVM LOCAL end */      
     )

Modified: llvm-gcc-4-2/trunk/gcc/gimplify.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/gimplify.c?rev=39948&r1=39947&r2=39948&view=diff

==============================================================================
--- 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





More information about the llvm-commits mailing list