Author: laijx
Date: 2011-07-12 22:39:29 -0400 (Tue, 12 Jul 2011)
New Revision: 3689

Modified:
   trunk/osprey/be/opt/opt_htable.cxx
Log:
Re-patch rev 3688 and re-fix bug 830.

Add_idef() is used for both ILOAD and ISTORE. For ISTORE, the lbase is NULL but 
previous patch doesn't check that. Also, previous patch doesn't work for store 
to constant address like:
*(int*)0xffffffffffff8001 = val;

The new patch checks if the lbase or sbase is NULL and works for both 
ILOAD/ISTORE to constant address.

Approved by Sun Chan.



Modified: trunk/osprey/be/opt/opt_htable.cxx
===================================================================
--- trunk/osprey/be/opt/opt_htable.cxx  2011-07-11 09:04:36 UTC (rev 3688)
+++ trunk/osprey/be/opt/opt_htable.cxx  2011-07-13 02:39:29 UTC (rev 3689)
@@ -2534,9 +2534,13 @@
   CODEREP          *retv;
   OPERATOR         oper = OPCODE_operator(opc);
 
-  // make sure the dtyp for address const is Pointer_type
-  if (lbase->Kind() == CK_CONST && lbase->Dtyp() != Pointer_type)
+  // make sure the dtyp for constant base is Pointer_type
+  if (lbase != NULL && lbase->Kind() == CK_CONST 
+      && lbase->Dtyp() != Pointer_type)
     lbase->Set_dtyp_strictly(Pointer_type);
+  if (sbase != NULL && sbase->Kind() == CK_CONST 
+      && sbase->Dtyp() != Pointer_type)
+    sbase->Set_dtyp_strictly(Pointer_type);
 
   cr->Init_ivar(opc, dtyp, occ, dsctyp, lodty, lbase, sbase,
                ofst, size, field_id);


------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to