Tweak check to avoid integer overflow (for insanely large alignments)

llvm-svn: 174482
This commit is contained in:
Evan Cheng 2013-02-06 02:06:33 +00:00
parent 4b00144e1b
commit a72b9709d7
1 changed files with 2 additions and 2 deletions

View File

@ -3520,7 +3520,7 @@ void SelectionDAGBuilder::visitAtomicLoad(const LoadInst &I) {
EVT VT = TLI.getValueType(I.getType()); EVT VT = TLI.getValueType(I.getType());
if (I.getAlignment() * 8 < VT.getSizeInBits()) if (I.getAlignment() < VT.getSizeInBits() / 8)
report_fatal_error("Cannot generate unaligned atomic load"); report_fatal_error("Cannot generate unaligned atomic load");
SDValue L = SDValue L =
@ -3550,7 +3550,7 @@ void SelectionDAGBuilder::visitAtomicStore(const StoreInst &I) {
EVT VT = TLI.getValueType(I.getValueOperand()->getType()); EVT VT = TLI.getValueType(I.getValueOperand()->getType());
if (I.getAlignment() * 8 < VT.getSizeInBits()) if (I.getAlignment() < VT.getSizeInBits() / 8)
report_fatal_error("Cannot generate unaligned atomic store"); report_fatal_error("Cannot generate unaligned atomic store");
if (TLI.getInsertFencesForAtomic()) if (TLI.getInsertFencesForAtomic())