Index: osprey/be/lno/snl_utils.cxx
===================================================================
--- osprey/be/lno/snl_utils.cxx (revision 3585)
+++ osprey/be/lno/snl_utils.cxx (working copy)
@@ -384,7 +384,7 @@

   switch (opr) {
    case OPR_INTCONST:
-    WN_const_val(wn) += c;
+    WN_UpdateIntconst(wn, WN_const_val(wn) + c);
     break;
    case OPR_MAX:
    case OPR_MIN:
@@ -395,9 +395,9 @@
    case OPR_SUB:
     if (WN_operator(WN_kid1(wn)) == OPR_INTCONST) {
       if (opr == OPR_ADD)
-       WN_const_val(WN_kid1(wn)) += c;
+        WN_UpdateIntconst(WN_kid1(wn), WN_const_val(WN_kid1(wn)) + c);
       else
-       WN_const_val(WN_kid1(wn)) -= c;
+           WN_UpdateIntconst(WN_kid1(wn), WN_const_val(WN_kid1(wn)) - c);
     }
     else
       Increase_By(WN_kid0(wn), c, wn, 0);
Index: osprey/common/com/wn.h
===================================================================
--- osprey/common/com/wn.h      (revision 3585)
+++ osprey/common/com/wn.h      (working copy)
@@ -985,6 +985,8 @@
                            OPCODE_desc(opc), const_val);
 }

+extern void WN_UpdateIntconst(WN* wn, INT64 const_val);
+
 extern WN *WN_CreateCvtl(OPERATOR opr,
                         TYPE_ID rtype,
                         TYPE_ID desc,
Index: osprey/common/com/wn.cxx
===================================================================
--- osprey/common/com/wn.cxx    (revision 3585)
+++ osprey/common/com/wn.cxx    (working copy)
@@ -1971,6 +1971,29 @@
   return(wn);
 }

+// update int constant value.
+// handling U4 int constant same way as WN_CreateIntconst
+void WN_UpdateIntconst(WN* wn, INT64 const_val)
+{
+  OPCODE opc = WN_opcode(wn);
+  Is_True(OPCODE_operator(opc) == OPR_INTCONST,
+    ("Bad opcode in WN_UpdateIntconst"));
+
+  if (opc == OPC_U4INTCONST) {
+#ifndef TARG_X8664
+       /* make sure that 32-bit value is sign-extended */
+       UINT32 uval = const_val;
+       INT32 sval = uval;
+       WN_const_val(wn) = (INT64) sval;
+#else
+       WN_const_val(wn) = const_val & 0x0ffffffffLL;
+#endif
+  } else {
+       WN_const_val(wn) = const_val;
+  }
+
+}
+
 WN *WN_CreateComma(OPERATOR opr, TYPE_ID rtype, TYPE_ID desc,
                   WN *block, WN *value)
 {
