Author: fengzhou
Date: 2011-03-07 12:16:16 -0500 (Mon, 07 Mar 2011)
New Revision: 3510

Modified:
   trunk/osprey/be/opt/opt_bdce.cxx
Log:
Fix bug #544. Added a cvt operation for the operands if they are longer than 
32-bit. 

Code Reviewer: Fred Chow


Modified: trunk/osprey/be/opt/opt_bdce.cxx
===================================================================
--- trunk/osprey/be/opt/opt_bdce.cxx    2011-03-07 12:11:28 UTC (rev 3509)
+++ trunk/osprey/be/opt/opt_bdce.cxx    2011-03-07 17:16:16 UTC (rev 3510)
@@ -1452,6 +1452,7 @@
              opr == OPR_ADD || opr == OPR_SUB || opr == OPR_MPY ||
              opr == OPR_BAND || opr == OPR_BIOR || opr == OPR_BNOR ||
              opr == OPR_BXOR || opr == OPR_LAND || opr == OPR_LIOR)) {
+      INT index;
       // change the operation to 32-bit, which is good for 32-bit target
       cr->Set_dtyp(Mtype_TransferSize(MTYPE_I4, cr->Dtyp()));
       if (cr->Dsctyp() != MTYPE_V)
@@ -1459,6 +1460,18 @@
       new_cr->Set_dtyp(Mtype_TransferSize(MTYPE_I4, new_cr->Dtyp()));
       if (new_cr->Dsctyp() != MTYPE_V)
         new_cr->Set_dsctyp(Mtype_TransferSize(MTYPE_I4, new_cr->Dsctyp()));
+
+      for (index = 0; index < new_cr->Kid_count(); index++) {
+          CODEREP *opnd = new_cr->Opnd(index);
+
+          if (new_cr->Dtyp() != opnd->Dtyp()) {
+              OPCODE   opc = OPCODE_make_op(OPR_CVT, new_cr->Dtyp(), 
opnd->Dtyp());
+              CODEREP *cvt_cr = Htable()->Add_unary_node(opc, opnd);
+
+              new_cr->Set_opnd(index, cvt_cr);
+              need_rehash = TRUE;
+          }
+      }
     }
 #endif
     // can also apply to some BAND and BIOR with constants


------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to