summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2007-10-12 15:31:31 +0000
committerNeil Booth <neil@daikokuya.co.uk>2007-10-12 15:31:31 +0000
commit7e74b17ad29f187ee30cf2a2ab110af19a161f89 (patch)
tree15f2bda6fadf9a8c7937d9ae76c0d1277bb7d9cd /llvm/lib/Support/APInt.cpp
parentdc35bd79caa48dd0e1a616749abb65339c3a8c4b (diff)
downloadbcm5719-llvm-7e74b17ad29f187ee30cf2a2ab110af19a161f89.tar.gz
bcm5719-llvm-7e74b17ad29f187ee30cf2a2ab110af19a161f89.zip
Don't attempt to mask no bits
llvm-svn: 42909
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 2e537d66da7..c5abf4bf163 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -2212,7 +2212,8 @@ APInt::tcExtract(integerPart *dst, unsigned int dstCount, const integerPart *src
dst[dstParts - 1] |= ((src[firstSrcPart + dstParts] & mask)
<< n % integerPartWidth);
} else if (n > srcBits) {
- dst[dstParts - 1] &= lowBitMask (srcBits % integerPartWidth);
+ if (srcBits % integerPartWidth)
+ dst[dstParts - 1] &= lowBitMask (srcBits % integerPartWidth);
}
/* Clear high parts. */
OpenPOWER on IntegriCloud