diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-14 01:28:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-14 01:28:02 +0000 |
commit | f8ee6bc1ef0eec8e22b413dfc2baa3cfa4f19f91 (patch) | |
tree | 957cfdfc9bd269ada3bd433bdf1430dd3e1548c8 /utils/TableGen | |
parent | 4bc2d1e4ad46d4d5e598aa2e11c67df562e0908b (diff) |
Fix undefined behavior (and wrong code, as far as I can tell) in NEON builtin
tablegen code, found by -fcatch-undefined-behavior. I would appreciate if
someone more familiar with the NEON code could point me in the direction of how
to write a test for this. We appear to have essentially no test coverage
whatsoever for these builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/NeonEmitter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp index 2e14b80748..73a2d0ef33 100644 --- a/utils/TableGen/NeonEmitter.cpp +++ b/utils/TableGen/NeonEmitter.cpp @@ -1504,7 +1504,7 @@ void NeonEmitter::runHeader(raw_ostream &OS) { throw TGError(R->getLoc(), "Builtin has no class kind"); int si = -1, qi = -1; - unsigned mask = 0, qmask = 0; + uint64_t mask = 0, qmask = 0; for (unsigned ti = 0, te = TypeVec.size(); ti != te; ++ti) { // Generate the switch case(s) for this builtin for the type validation. bool quad = false, poly = false, usgn = false; @@ -1512,10 +1512,10 @@ void NeonEmitter::runHeader(raw_ostream &OS) { if (quad) { qi = ti; - qmask |= 1 << GetNeonEnum(Proto, TypeVec[ti]); + qmask |= 1ULL << GetNeonEnum(Proto, TypeVec[ti]); } else { si = ti; - mask |= 1 << GetNeonEnum(Proto, TypeVec[ti]); + mask |= 1ULL << GetNeonEnum(Proto, TypeVec[ti]); } } |