From f7fe494c198d946c57a6275d0ec18c517f4022bd Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 3 Mar 2005 01:04:50 +0000 Subject: [PATCH] Do not lower malloc's to pass "sizeof" expressions like this: ltmp_0_7 = malloc(((unsigned )(&(((signed char (*)[784])/*NULL*/0)[1u])))); Instead, just emit the literal constant, like this: ltmp_0_7 = malloc(784u); This works around a bug in ICC 8.1 compiling the CBE generated code. :-( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20415 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/CBackend/CBackend.cpp | 2 +- lib/Target/CBackend/Writer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index dfd06a73e71..8505917a44e 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -1720,7 +1720,7 @@ void CWriter::visitVAArgInst(VAArgInst &I) { bool CTargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &o) { PM.add(createLowerGCPass()); - PM.add(createLowerAllocationsPass()); + PM.add(createLowerAllocationsPass(true)); PM.add(createLowerInvokePass()); PM.add(new CBackendNameAllUsedStructs()); PM.add(new CWriter(o, getIntrinsicLowering())); diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index dfd06a73e71..8505917a44e 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -1720,7 +1720,7 @@ void CWriter::visitVAArgInst(VAArgInst &I) { bool CTargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &o) { PM.add(createLowerGCPass()); - PM.add(createLowerAllocationsPass()); + PM.add(createLowerAllocationsPass(true)); PM.add(createLowerInvokePass()); PM.add(new CBackendNameAllUsedStructs()); PM.add(new CWriter(o, getIntrinsicLowering()));