[llvm-commits] CVS: gcc-3.4/gcc/llvm-expand.c

Chris Lattner lattner at cs.uiuc.edu
Sun Mar 7 20:33:30 PST 2004


Changes in directory gcc-3.4/gcc:

llvm-expand.c updated: 1.17 -> 1.18

---
Log message:

Fix CFrontend/2004-03-07-ExternalConstant.c.tr
We weren't marking globals constant if they were external.


---
Diffs of the changes:  (+5 -4)

Index: gcc-3.4/gcc/llvm-expand.c
diff -u gcc-3.4/gcc/llvm-expand.c:1.17 gcc-3.4/gcc/llvm-expand.c:1.18
--- gcc-3.4/gcc/llvm-expand.c:1.17	Tue Mar  2 14:19:36 2004
+++ gcc-3.4/gcc/llvm-expand.c	Sun Mar  7 20:13:21 2004
@@ -322,8 +322,9 @@
   }
 }
 
-// EmitMemCpyMove - Emit a call to llvm.memcpy or llvm.memmove (depending on
-// whether the isMove flag is set).
+/* EmitMemCpyMove - Emit a call to llvm.memcpy or llvm.memmove (depending on
+ * whether the isMove flag is set).
+ */
 static void EmitMemCpyMove(llvm_function *Fn, llvm_value *DestPtr,
                            llvm_value *SrcPtr, llvm_value *Size,
                            unsigned Alignment, int isMove) {
@@ -6810,8 +6811,8 @@
       G->Linkage = L_LinkOnce;
       } else if (*/DECL_WEAK(decl) || DECL_COMMON(decl) || DECL_VIRTUAL_P(decl))
       G->Linkage = L_Weak;
-    if (TREE_READONLY(decl) && DECL_INITIAL(decl) &&
-        TREE_CONSTANT(DECL_INITIAL(decl)) && !TREE_SIDE_EFFECTS(decl))
+    if (TREE_READONLY(decl) && !TREE_SIDE_EFFECTS(decl) &&
+        (!DECL_INITIAL(decl) || TREE_CONSTANT(DECL_INITIAL(decl))))
       G->isConstant = 1;
     
     /* Allociate the LLVM global with the tree global */





More information about the llvm-commits mailing list