Index: osprey/be/opt/opt_wn.cxx
===================================================================
--- osprey/be/opt/opt_wn.cxx	(revision 3380)
+++ osprey/be/opt/opt_wn.cxx	(working copy)
@@ -1500,9 +1500,15 @@
 
   if (sym->Bit_size () > 0) {
     if (sym->Field_id() == 0) { 
+      Is_True((WN_map_id(rhs) == -1 ||
+            OPERATOR_mapcat(WN_operator(rhs)) == OPERATOR_mapcat(OPR_LDBITS)),
+          ("WN's new operator belongs to a different mapcat in Create_identity_assignment"));
       WN_set_operator (rhs, OPR_LDBITS);
       WN_set_bit_offset_size (rhs, sym->Bit_ofst (), sym->Bit_size ());
   
+      Is_True((WN_map_id(copy) == -1 ||
+            OPERATOR_mapcat(WN_operator(copy)) == OPERATOR_mapcat(OPR_STBITS)),
+          ("WN's new operator belongs to a different mapcat in Create_identity_assignment"));
       WN_set_operator (copy, OPR_STBITS);
       WN_set_bit_offset_size (copy, sym->Bit_ofst (), sym->Bit_size ());
     }
Index: osprey/be/opt/opt_etable.cxx
===================================================================
--- osprey/be/opt/opt_etable.cxx	(revision 3380)
+++ osprey/be/opt/opt_etable.cxx	(working copy)
@@ -484,6 +484,9 @@
 			      Field_id());
 			      
       if (opt_stab->Bit_size (Aux_id()) > 0) {
+        Is_True((WN_map_id(home_wn) == -1 ||
+            OPERATOR_mapcat(WN_operator(home_wn)) == OPERATOR_mapcat(OPR_LDBITS)),
+            ("WN's new operator belongs to a different mapcat in CODEREP::Rvi_home_wn"));
 	WN_set_operator (home_wn, OPR_LDBITS);
 	WN_set_bit_offset_size (home_wn, Bit_offset (), Bit_size ());
       }
Index: osprey/be/opt/opt_htable_emit.cxx
===================================================================
--- osprey/be/opt/opt_htable_emit.cxx	(revision 3380)
+++ osprey/be/opt/opt_htable_emit.cxx	(working copy)
@@ -348,8 +348,12 @@
 				iv->Field_id());
 #ifdef TARG_LOONGSON
       // Need to change operator of induction to OPT_LDBITS when induction is BITs variable
-      if (iv->Points_to(Opt_stab())->Bit_Size() != 0)
+      if (iv->Points_to(Opt_stab())->Bit_Size() != 0) {
+        Is_True((WN_map_id(induction) == -1 ||
+              OPERATOR_mapcat(WN_operator(induction)) == OPERATOR_mapcat(OPR_LDBITS)),
+            ("WN's new operator belongs to a different mapcat in Create_identity_assignment"));
         WN_set_operator(induction, OPR_LDBITS);
+      }
 #endif
       if (Do_rvi() && ST_class(WN_st(induction)) != CLASS_PREG) {
 	Warn_todo("ML_WHIRL_EMITTER::Build_loop_info: do not adjust bitpos by 1" );
Index: osprey/be/opt/opt_sym.cxx
===================================================================
--- osprey/be/opt/opt_sym.cxx	(revision 3380)
+++ osprey/be/opt/opt_sym.cxx	(working copy)
@@ -1727,12 +1727,18 @@
                   OPERATOR_name(opr)));
 	rtype = WN_rtype(twn);
 	desc = WN_desc(twn);
+        // reset map_id since OPR_INTCONST is in different mapcat group than OPR_LDID/OPR_LDBITS.
+        if (opr == OPR_INTCONST) 
+          WN_set_map_id(wn, -1);
+        Is_True((WN_map_id(wn) == -1 ||
+              OPERATOR_mapcat(WN_operator(wn)) == OPERATOR_mapcat(opr)),
+            ("WN's new operator belongs to a different mapcat in OPT_STAB::Convert_ST_to_AUX"));
         WN_set_operator(wn, opr);
 	WN_set_rtype(wn, rtype);
 	WN_set_desc(wn, desc);
-        if (opr == OPR_INTCONST)
+        if (opr == OPR_INTCONST) {
           WN_const_val(wn) = WN_const_val(twn);
-        else {
+        } else {
           WN_load_offset(wn) = WN_load_offset(twn);
           WN_st_idx(wn) = WN_st_idx(twn);
           WN_set_ty(wn, WN_ty(twn));
@@ -1760,6 +1766,9 @@
 	opr = WN_operator(twn);
 	rtype = WN_rtype(twn);
 	desc = WN_desc(twn);
+        Is_True((WN_map_id(wn) == -1 ||
+            OPERATOR_mapcat(WN_operator(wn)) == OPERATOR_mapcat(opr)),
+            ("WN's new operator belongs to a different mapcat in OPT_STAB::Convert_ST_to_AUX"));
         WN_set_operator(wn, opr);
 	WN_set_rtype(wn, rtype);
 	WN_set_desc(wn, desc);
@@ -1791,6 +1800,9 @@
     if (opr == OPR_TRUEBR && WN_const_val(test) != 0 ||
 	opr == OPR_FALSEBR && WN_const_val(test) == 0) {
       WN_Delete(test);
+      Is_True((WN_map_id(wn) == -1 ||
+            OPERATOR_mapcat(WN_operator(wn)) == OPERATOR_mapcat(OPR_GOTO)),
+          ("WN's new operator belongs to a different mapcat in OPT_STAB::Convert_ST_to_AUX"));
       WN_set_operator(wn, OPR_GOTO);
       WN_set_rtype(wn, MTYPE_V);
       WN_set_desc(wn, MTYPE_V);
