Fix checks for kLiteral in local optimizations.

The check for kLiteral (literal load) just checked the kLiteral
bit in the def mask.  The kEncodeAll mask has the kLiteral bit
set so this check was triggering.  The fix is to check for
only the kLiteral bit being set and no other special bits.

The semantics of the special bits in the use/def mask is that
only one of them can be set at the same time.

Bug: 16824330

Change-Id: I0f1c1157e017870414ffef11767e5433d1fd4401
diff --git a/compiler/dex/quick/local_optimizations.cc b/compiler/dex/quick/local_optimizations.cc
index eec2b32..e0f4691 100644
--- a/compiler/dex/quick/local_optimizations.cc
+++ b/compiler/dex/quick/local_optimizations.cc
@@ -200,7 +200,7 @@
     /* Initialize alias list */
     alias_list.clear();
     ResourceMask alias_reg_list_mask = kEncodeNone;
-    if (!this_mem_mask.Intersects(kEncodeLiteral)) {
+    if (!this_mem_mask.Intersects(kEncodeMem) && !this_mem_mask.Intersects(kEncodeLiteral)) {
       alias_list.push_back(dest_reg_id);
       SetupRegMask(&alias_reg_list_mask, dest_reg_id);
     }
@@ -248,7 +248,7 @@
         bool is_check_lir_load = check_flags & IS_LOAD;
         bool reg_compatible = RegStorage::SameRegType(check_lir->operands[0], native_reg_id);
 
-        if (alias_mem_mask.Equals(kEncodeLiteral)) {
+        if (!alias_mem_mask.Intersects(kEncodeMem) && alias_mem_mask.Equals(kEncodeLiteral)) {
           DCHECK(check_flags & IS_LOAD);
           /* Same value && same register type */
           if (reg_compatible && (this_lir->target == check_lir->target)) {