Fix rdar://7694996 a miscompile of 183.equake from my patch yesterday,
authorChris Lattner <sabre@nondot.org>
Fri, 26 Feb 2010 23:42:13 +0000 (23:42 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 26 Feb 2010 23:42:13 +0000 (23:42 +0000)
confusing the old MAT variable with the new GlobalType one.  This caused
us to promote the @disp global pointer into:

@disp.body = internal global double*** undef

instead of:

@disp.body = internal global [3 x double**] undef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97285 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/GlobalOpt.cpp

index 2ba7ed9fe99471eda8fb710f5367966b077d7d65..7b1e9c0efdd1cb3da15e8fee4596e5f58d0464c8 100644 (file)
@@ -826,11 +826,10 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV,
 
   // Create the new global variable.  The contents of the malloc'd memory is
   // undefined, so initialize with an undef value.
-  const Type *MAT = getMallocAllocatedType(CI);
   GlobalVariable *NewGV = new GlobalVariable(*GV->getParent(), 
-                                             MAT, false,
+                                             GlobalType, false,
                                              GlobalValue::InternalLinkage,
-                                             UndefValue::get(MAT),
+                                             UndefValue::get(GlobalType),
                                              GV->getName()+".body",
                                              GV,
                                              GV->isThreadLocal());