aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-io.c
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2006-04-18 16:05:42 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2006-04-18 16:05:42 +0000
commit7ae993371973b3d9cbac92704194033c252631f8 (patch)
treefb743670f2adbfb035ff0205f1d04fe2249fb01b /gcc/fortran/trans-io.c
parent503b5c9f9ef343640c86afe451a2d98e326f139e (diff)
downloadgcc-7ae993371973b3d9cbac92704194033c252631f8.zip
gcc-7ae993371973b3d9cbac92704194033c252631f8.tar.gz
gcc-7ae993371973b3d9cbac92704194033c252631f8.tar.bz2
* trans-io.c (gfc_build_io_library_fndecls): Align pad.
From-SVN: r113047
Diffstat (limited to 'gcc/fortran/trans-io.c')
-rw-r--r--gcc/fortran/trans-io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 9a60161..b4c83f4 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -227,6 +227,14 @@ gfc_build_io_library_fndecls (void)
pad_size += 32 * TREE_INT_CST_LOW (TYPE_SIZE_UNIT (integer_type_node));
pad_idx = build_index_type (build_int_cst (NULL_TREE, pad_size));
types[IOPARM_type_pad] = build_array_type (char_type_node, pad_idx);
+
+ /* pad actually contains pointers and integers so it needs to have an
+ alignment that is at least as large as the needed alignment for those
+ types. See the st_parameter_dt structure in libgfortran/io/io.h for
+ what really goes into this space. */
+ TYPE_ALIGN (types[IOPARM_type_pad]) = MAX (TYPE_ALIGN (pchar_type_node),
+ TYPE_ALIGN (gfc_get_int_type (gfc_max_integer_kind)));
+
gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind);
for (ptype = IOPARM_ptype_common; ptype < IOPARM_ptype_num; ptype++)