GBE: fallback if we get a wider than i64 constant.
authorZhigang Gong <zhigang.gong@intel.com>
Fri, 5 Sep 2014 08:33:44 +0000 (16:33 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Fri, 5 Sep 2014 09:09:28 +0000 (17:09 +0800)
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Tested-by: Meng, Mengmeng <mengmeng.meng@intel.com>
backend/src/llvm/llvm_gen_backend.cpp

index 738f7d3..39620f6 100644 (file)
@@ -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()));
         }
       }