diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index a772a46ba6..024a163737 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -6564,7 +6564,11 @@ unsigned SelectionDAG::InferPtrAlignment(SDValue Ptr) const { } } if (!Align) - Align = TLI.getTargetData()->getABITypeAlignment(GV->getType()); + // Conservatively returns zero here instead of using ABI alignment for + // type of the GV. If the type is a "packed" type, then the under- + // specified alignments is attached to the load / store instructions. + // In that case, the alignment of the type cannot be trusted. + return 0; } return MinAlign(Align, GVOffset); } |