Author: yug
Date: 2012-04-12 04:48:34 -0400 (Thu, 12 Apr 2012)
New Revision: 3906

Modified:
   trunk/osprey/be/cg/cgexp_internals.h
   trunk/osprey/be/cg/whirl2ops.cxx
   trunk/osprey/be/cg/x8664/expand.cxx
Log:
fix for bug952.

In the expansion of OPR_STID for X8664 -m32 target,  
when the kid is 64bit result with paired TN but the stid_type
is 4byte size or less, we delete the useless higher 32bit tn 
by unpair the result. This will help pass the pair check in the 
following expansion routines.

Code Review: Lai Jian-Xin.


Modified: trunk/osprey/be/cg/cgexp_internals.h
===================================================================
--- trunk/osprey/be/cg/cgexp_internals.h        2012-04-12 08:28:19 UTC (rev 
3905)
+++ trunk/osprey/be/cg/cgexp_internals.h        2012-04-12 08:48:34 UTC (rev 
3906)
@@ -145,6 +145,7 @@
 TN* Get_TN_Pair( TN* );
 TN* Create_TN_Pair( TN*, TYPE_ID );
 void Create_TN_Pair( TN*, TN* );
+void Delete_TN_Pair( TN* );
 #endif /* TARG_X8664 */
 
 #if defined(TARG_IA64) || defined(TARG_LOONGSON)

Modified: trunk/osprey/be/cg/whirl2ops.cxx
===================================================================
--- trunk/osprey/be/cg/whirl2ops.cxx    2012-04-12 08:28:19 UTC (rev 3905)
+++ trunk/osprey/be/cg/whirl2ops.cxx    2012-04-12 08:48:34 UTC (rev 3906)
@@ -2775,6 +2775,19 @@
        TN* result_hi = Get_TN_Pair( result );
        Expand_Immediate( result_hi, Gen_Literal_TN(0,4), FALSE, &New_OPs );
       }
+      
+      // open64.net bug952. 
+      // When the kid is 64bit result with paired TN but the stid_type
+      // is 4byte size or less, We delete the useless higher 32bit tn 
+      // by unpair the result. this will help pass the pair check in the 
+      // later expansion routines.
+
+      if (OP_NEED_PAIR(kid0_type) &&
+          Get_TN_Pair(result) != NULL &&
+          MTYPE_byte_size(stid_type) < MTYPE_byte_size(kid0_type)) {
+        Delete_TN_Pair(result);
+      }
+
 #endif // TARG_X8664
 
 #endif // IA_32

Modified: trunk/osprey/be/cg/x8664/expand.cxx
===================================================================
--- trunk/osprey/be/cg/x8664/expand.cxx 2012-04-12 08:28:19 UTC (rev 3905)
+++ trunk/osprey/be/cg/x8664/expand.cxx 2012-04-12 08:48:34 UTC (rev 3906)
@@ -282,6 +282,11 @@
   return pair;
 }
 
+void Delete_TN_Pair( TN *key) 
+{
+  Is_True( Get_TN_Pair( key ) != NULL, ("Delete_TN_Pair: higher 32-bit is 
NULL") );
+  TN_MAP_Set( _TN_Pair_table, key, NULL );
+}
 
 void Create_TN_Pair( TN* key, TN* pair )
 {


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to