Author: yug
Date: 2012-02-08 03:30:01 -0500 (Wed, 08 Feb 2012)
New Revision: 3868

Modified:
   trunk/osprey/be/cg/x8664/ebo_special.cxx
Log:
fix for bug941.

under m32, at ebo post process phase, we disable the change of compare ops from 
32bit to 8bit
if the source register is not byte addressable.

Code Review: Lai Jian-Xin.


Modified: trunk/osprey/be/cg/x8664/ebo_special.cxx
===================================================================
--- trunk/osprey/be/cg/x8664/ebo_special.cxx    2012-02-07 19:06:03 UTC (rev 
3867)
+++ trunk/osprey/be/cg/x8664/ebo_special.cxx    2012-02-08 08:30:01 UTC (rev 
3868)
@@ -3507,6 +3507,22 @@
     return FALSE;
   }
 
+  // open64.net bug941. under m32, at ebo post process phase
+  // if the new_top is set to 8bit operator and the GPR is not 8byte 
addressable 
+  // we disable the change of op.
+  if ( Is_Target_32bit() &&
+       EBO_in_peep &&
+       ( new_top == TOP_cmpi8 ||
+         new_top == TOP_test8 || 
+         new_top == TOP_testi8 ||
+         new_top == TOP_cmp8)) {
+    const REGISTER_SET regs = 
REGISTER_SUBCLASS_members(ISA_REGISTER_SUBCLASS_m32_8bit_regs);
+    if ( TN_is_register(new_src0) && !REGISTER_SET_MemberP(regs, 
TN_register(new_src0) )) 
+        return FALSE;
+    if ( TN_is_register(new_src1) && !REGISTER_SET_MemberP(regs, 
TN_register(new_src1) ))
+        return FALSE;
+  }         
+
   OP* new_op = Mk_OP( new_top, Rflags_TN(), new_src0, new_src1 );
   Set_OP_unrolling( new_op, OP_unrolling ( op ) );
   Set_OP_orig_idx( new_op, OP_map_idx ( op ) );


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to