aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Target/SparcV9/SparcV9BurgISel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/SparcV9/SparcV9BurgISel.cpp b/lib/Target/SparcV9/SparcV9BurgISel.cpp
index fd03641786..1c03a9eb86 100644
--- a/lib/Target/SparcV9/SparcV9BurgISel.cpp
+++ b/lib/Target/SparcV9/SparcV9BurgISel.cpp
@@ -1139,7 +1139,8 @@ void CreateCodeToLoadConst(const TargetMachine& target, Function* F,
// Get the constant pool index for this constant
MachineConstantPool *CP = MachineFunction::get(F).getConstantPool();
Constant *C = cast<Constant>(val);
- unsigned CPI = CP->getConstantPoolIndex(C);
+ unsigned Align = target.getTargetData().getTypeAlignmentShift(C->getType());
+ unsigned CPI = CP->getConstantPoolIndex(C, Align);
// Put the address of the constant into a register
MachineInstr* MI;