Author: zhuqing
Date: 2010-11-30 01:53:24 -0500 (Tue, 30 Nov 2010)
New Revision: 3411

Modified:
   trunk/osprey/be/com/data_layout.cxx
Log:
Fix bug580
Reviewed by Jianxin 


Modified: trunk/osprey/be/com/data_layout.cxx
===================================================================
--- trunk/osprey/be/com/data_layout.cxx 2010-11-29 23:22:50 UTC (rev 3410)
+++ trunk/osprey/be/com/data_layout.cxx 2010-11-30 06:53:24 UTC (rev 3411)
@@ -649,8 +649,16 @@
 {
   UINT align = Adjusted_Alignment(blk);
   INT64 old_offset;
-  INT64 size = ST_size(blk);
-
+  INT64 size;
+  INITO_IDX ino_idx;
+  // if blk is variable length struct, its size should be inito size.
+  if (TY_kind(ST_type(blk)) == KIND_STRUCT && (ino_idx = 
Find_INITO_For_Symbol(blk)) != 0)
+  {
+    size = Get_INITO_Size(ino_idx);
+    Is_True(size >= ST_size(blk),("%s's inito size smaller than 
ST_size",ST_name(blk)));
+  }
+  else
+    size = ST_size(blk);
 #if defined(TARG_PPC32)
   if ( ST_sclass(blk) == SCLASS_FORMAL && MTYPE_is_m(TY_mtype(ST_type(blk))) ) 
{
     size = MTYPE_RegisterSize(Spill_Int_Mtype);;


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to