Author: zhangliwei830114
Date: 2012-04-26 03:51:19 -0400 (Thu, 26 Apr 2012)
New Revision: 3917

Modified:
   trunk/osprey/be/com/data_layout.cxx
Log:
Fix bug 1800: 
        About __attribute__((aligned(xxx))): some variable's align is wrong.
Analysis: 
        In data layout phase, variable's end is also aligned which cause a 
variable 'a' align by the stricter align of 'a' and the last variable before 
'a'.
Solution:
        Delete the variable's end align.

CR: Sun Chan and Jian-Xin


Modified: trunk/osprey/be/com/data_layout.cxx
===================================================================
--- trunk/osprey/be/com/data_layout.cxx 2012-04-24 19:21:26 UTC (rev 3916)
+++ trunk/osprey/be/com/data_layout.cxx 2012-04-26 07:51:19 UTC (rev 3917)
@@ -679,12 +679,13 @@
   if (!STB_decrement(base)) {
     old_offset = STB_size(base);
     Set_ST_ofst(blk, ROUNDUP(old_offset + lpad, align));
-    Set_STB_size(base, ROUNDUP(ST_ofst(blk) + size + rpad, align));
+    Set_STB_size(base, ST_ofst(blk) + size + rpad);
   }
   else {
     old_offset = STB_size(base);
     /* align object end */
-    Set_ST_ofst(blk, ROUNDUP(old_offset + lpad, align));       
+    /* open64.net bug[968]: here need not align object end */
+    Set_ST_ofst(blk, old_offset + lpad);       
     Set_ST_ofst(blk,
        -(INT64) ROUNDUP(ST_ofst(blk) + size + rpad, align)); /* start */
     Set_STB_size(base, -ST_ofst(blk));


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to