summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2014-09-05 16:33:44 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-09-05 17:09:28 +0800
commit594a9104a4194b1e0cc224c0c772fe4606d3894a (patch)
tree3e199c2d30e44c845969e1fc5411b83de0663955
parent0bff216aa6625e68fd2548edc5d073ff9c4a3811 (diff)
GBE: fallback if we get a wider than i64 constant.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Tested-by: Meng, Mengmeng <mengmeng.meng@intel.com>
-rw-r--r--backend/src/llvm/llvm_gen_backend.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 738f7d3..39620f6 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -879,6 +879,10 @@ namespace gbe
const uint64_t u64 = CI->getZExtValue();
return ctx.newImmediate(u64);
} else {
+ if (CI->getValue().getActiveBits() > 64) {
+ ctx.getUnit().setValid(false);
+ return ctx.newImmediate(uint64_t(0));
+ }
return ctx.newImmediate(uint64_t(CI->getZExtValue()));
}
}