aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-06-04 23:37:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-06-04 23:37:54 +0000
commit36cd886d9a864f23b8f6f0231fbbffa5e5256481 (patch)
treedd84e845d53ad6928fbf8c01beef6adf3d22869a /lib/CodeGen
parentf5e33e897bd1563de13cadacc3f9860a8aea67c8 (diff)
downloadexternal_llvm-36cd886d9a864f23b8f6f0231fbbffa5e5256481.zip
external_llvm-36cd886d9a864f23b8f6f0231fbbffa5e5256481.tar.gz
external_llvm-36cd886d9a864f23b8f6f0231fbbffa5e5256481.tar.bz2
Fix a memcpy lowering bug. Even though the memcpy alignment is smaller than the desired alignment, the frame destination alignment may still be larger than the desired alignment. Don't change its alignment to something smaller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index a9b7381..8d0d344 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2633,8 +2633,9 @@ bool MeetsMaxMemopRequirement(std::vector<MVT::ValueType> &MemOps,
if (AllowUnalign)
VT = MVT::iAny;
} else {
- // Give the stack frame object a larger alignment.
- MFI->setObjectAlignment(FI, NewAlign);
+ // Give the stack frame object a larger alignment if needed.
+ if (MFI->getObjectAlignment(FI) < NewAlign)
+ MFI->setObjectAlignment(FI, NewAlign);
Align = NewAlign;
}
}