diff options
author | Chris Lattner <sabre@nondot.org> | 2010-09-27 06:44:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-09-27 06:44:54 +0000 |
commit | 9f06f911d197577b80d208a167980833b4fb9ad5 (patch) | |
tree | 6e92a19eb1ef843d25b82d377dd2ee9ff5283801 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | 4362a1c9871e87c283a9c2d475ff3ca6ec32febe (diff) | |
download | bcm5719-llvm-9f06f911d197577b80d208a167980833b4fb9ad5.tar.gz bcm5719-llvm-9f06f911d197577b80d208a167980833b4fb9ad5.zip |
the latest assembler that runs on powerpc 10.4 machines doesn't
support aligned comm. Detect when compiling for 10.4 and don't
emit an alignment for comm. THis will hopefully fix PR8198.
llvm-svn: 114817
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index ee6d321763a..0de20211336 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -282,8 +282,12 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) { // Handle common symbols. if (GVKind.isCommon()) { + unsigned Align = 1 << AlignLog; + if (!getObjFileLowering().getCommDirectiveSupportsAlignment()) + Align = 0; + // .comm _foo, 42, 4 - OutStreamer.EmitCommonSymbol(GVSym, Size, 1 << AlignLog); + OutStreamer.EmitCommonSymbol(GVSym, Size, Align); return; } @@ -301,11 +305,15 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) { OutStreamer.EmitLocalCommonSymbol(GVSym, Size); return; } + + unsigned Align = 1 << AlignLog; + if (!getObjFileLowering().getCommDirectiveSupportsAlignment()) + Align = 0; // .local _foo OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Local); // .comm _foo, 42, 4 - OutStreamer.EmitCommonSymbol(GVSym, Size, 1 << AlignLog); + OutStreamer.EmitCommonSymbol(GVSym, Size, Align); return; } |