aboutsummaryrefslogtreecommitdiff
path: root/gcc/f/equiv.c
diff options
context:
space:
mode:
authorCraig Burley <burley@gnu.org>1998-06-30 03:59:40 -0400
committerDave Love <fx@gcc.gnu.org>1998-06-30 07:59:40 +0000
commita6fa6420035fd39fb872da5dfd17f63e98739d75 (patch)
treebadf945c7c86aa03d0d5e89459b31761502c8973 /gcc/f/equiv.c
parent145836925d8c2f944add7dca7c6ea1629778a8b3 (diff)
downloadgcc-a6fa6420035fd39fb872da5dfd17f63e98739d75.zip
gcc-a6fa6420035fd39fb872da5dfd17f63e98739d75.tar.gz
gcc-a6fa6420035fd39fb872da5dfd17f63e98739d75.tar.bz2
Fix 980628-*.f:
Mon Jun 29 09:47:33 1998 Craig Burley <burley@gnu.org> Fix 980628-*.f: * bld.h: New `pad' field and accessor macros for ACCTER, ARRTER, and CONTER ops. * bld.c (ffebld_new_accter, ffebld_new_arrter, ffebld_new_conter_with_orig): Initialize `pad' field to zero. * com.c (ffecom_transform_common_): Include initial padding (aka modulo aka offset) in size calculation. Copy initial padding value into FFE initialization expression so the GBE transformation of that expression includes it. Make array low bound 0 instead of 1, for consistency. (ffecom_transform_equiv_): Include initial padding (aka modulo aka offset) in size calculation. Copy initial padding value into FFE initialization expression so the GBE transformation of that expression includes it. Make array low bound 0 instead of 1, for consistency. (ffecom_expr_, case FFEBLD_opACCTER): Delete unused `size' variable. Track destination offset separately, allowing for initial padding. Don't bother setting initial PURPOSE offset if zero. Include initial padding in size calculation. (ffecom_expr_, case FFEBLD_opARRTER): Allow for initial padding. Include initial padding in size calculation. Make array low bound 0 instead of 1, for consistency. (ffecom_finish_global_): Make array low bound 0 instead of 1, for consistency. (ffecom_notify_init_storage): Copy `pad' field from old ACCTER to new ARRTER. (ffecom_notify_init_symbol): Ditto. * data.c (ffedata_gather_): Initialize `pad' field in new ARRTER to 0. (ffedata_value_): Ditto. * equiv.c (ffeequiv_layout_local_): When lowering start of equiv area, extend lowering to maintain needed alignment. * target.c (ffetarget_align): Handle negative offset correctly. * global.c (ffeglobal_pad_common): Warn about non-zero padding only the first time its seen. If new padding larger than old, update old. (ffeglobal_save_common): Use correct type for size throughout. * global.h: Use correct type for size throughout. (ffeglobal_common_pad): New macro. (ffeglobal_pad): Delete this unused and broken macro. From-SVN: r20817
Diffstat (limited to 'gcc/f/equiv.c')
-rw-r--r--gcc/f/equiv.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/f/equiv.c b/gcc/f/equiv.c
index 33f2eed..9fd856b 100644
--- a/gcc/f/equiv.c
+++ b/gcc/f/equiv.c
@@ -435,18 +435,26 @@ ffeequiv_layout_local_ (ffeequiv eq)
{
ffetargetOffset new_size;
+ /* First, calculate the initial padding necessary
+ to preserve the current alignment/modulo requirements
+ for the storage area. */
+ pad = (-item_offset) % ffestorag_alignment (st);
+ if (pad != 0)
+ pad = ffestorag_alignment (st) - pad;
+
/* Increase size of equiv area to start for lower offset relative
to root symbol. */
-
- if (!ffetarget_offset_add (&new_size,
- ffestorag_offset (st) - item_offset,
+ if (! ffetarget_offset_add (&new_size,
+ (ffestorag_offset (st)
+ - item_offset)
+ + pad,
ffestorag_size (st)))
ffetarget_offset_overflow (ffesymbol_text (s));
else
ffestorag_set_size (st, new_size);
ffestorag_set_symbol (st, item_sym);
- ffestorag_set_offset (st, item_offset);
+ ffestorag_set_offset (st, item_offset - pad);
#if FFEEQUIV_DEBUG
fprintf (stderr, " [eq offset=%" ffetargetOffset_f