diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2008-09-23 03:52:19 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2008-09-23 03:52:19 +0000 |
commit | d7445152be468cc8de1ea0a3ab6555448086e951 (patch) | |
tree | ed1e0822525cb0910a79366e0c5da38734d18377 /gcc | |
parent | 9992fbb57107aa1f2448acbd641cc16b9c61b729 (diff) | |
download | gcc-d7445152be468cc8de1ea0a3ab6555448086e951.zip gcc-d7445152be468cc8de1ea0a3ab6555448086e951.tar.gz gcc-d7445152be468cc8de1ea0a3ab6555448086e951.tar.bz2 |
re PR fortran/37498 (Incorrect array value returned - 4.3 ABI Broken)
2008-09-22 Jerry DeLisle <jvdelisle@gcc.gnu.org
PR fortran/37498
* trans-io.c (gfc_build_io_library_fndecls): Bump pad size.
(build_dt): Set mask bit for IOPARM_dt_f2003.
* ioparm.def: Add IOPARM_dt_f2003.
2008-09-22 Jerry DeLisle <jvdelisle@gcc.gnu.org
PR libfortran/37498
* file_pos (st_endfile): Clear memory only for libfortran 4.3 private
area.
* list_read.c (eat_separator): Only access F2003 I/O parameters if
IOPARM_DT_HAS_F2003 bit is set. (parse_real): Ditto.
(read_real): Ditto.
* read.c (read_a): Likewise. (read_a_char4): Likewise though not
strictly necessary. (read_f): Likewise.
* io.h (unit_sign_s): New enumerator to allow duplication of
st_parameter structures. (IOPARM_DT_HAS_F2003): New mask bit.
(st_parameter_43): New structure copied from 4.3 version of
st_paramater_dt private section. (st_parameter_44): New structure with
F2003 items added. (st_parameter_dt): Modified to create union of new
and old structures to allow correct memory setting for 4.3 ABI
compatibility. Bumped the pad size.
* transfer.c (read_sf): Do not use F2003 I/O memory areas unless
IOPARM_DT_HAS_F2003 bit has been set. (read_block_form): Ditto.
(formatted_transfer_scalar): Ditto. (data_transfer_init): Ditto and
add comment, fix formatting.
* write.c (write_default_char4): Likewise though not strictly necessary.
(write_utf8_char4): Ditto. (write_character): Ditto.
(write_real_g0): Ditto. (list_formatted_write_scalar): Ditto.
(nml_write_obj): Ditto. (namelist_write): Ditto.
* write_float.def (calculate_sign): Eliminate warning by including all
cases in switch. (output_float): Output only decimal point of F2003 flag
is not set.
From-SVN: r140576
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/ioparm.def | 1 | ||||
-rw-r--r-- | gcc/fortran/trans-io.c | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7744ba4..afadaeb 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2008-09-22 Jerry DeLisle <jvdelisle@gcc.gnu.org + + PR fortran/37498 + * trans-io.c (gfc_build_io_library_fndecls): Bump pad size. + (build_dt): Set mask bit for IOPARM_dt_f2003. + * ioparm.def: Add IOPARM_dt_f2003. + 2008-09-22 Janus Weil <janus@gcc.gnu.org> PR fortran/37486 diff --git a/gcc/fortran/ioparm.def b/gcc/fortran/ioparm.def index deb1b98..ee3f6b2 100644 --- a/gcc/fortran/ioparm.def +++ b/gcc/fortran/ioparm.def @@ -93,3 +93,4 @@ IOPARM (dt, pad, 1 << 22, char1) IOPARM (dt, round, 1 << 23, char2) IOPARM (dt, sign, 1 << 24, char1) IOPARM (dt, u, 0, pad) +#define IOPARM_dt_f2003 (1 << 25) diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index 2452939..fdc517a 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -291,7 +291,7 @@ gfc_build_io_library_fndecls (void) = build_pointer_type (gfc_intio_type_node); types[IOPARM_type_parray] = pchar_type_node; types[IOPARM_type_pchar] = pchar_type_node; - pad_size = 16 * TREE_INT_CST_LOW (TYPE_SIZE_UNIT (pchar_type_node)); + pad_size = 32 * TREE_INT_CST_LOW (TYPE_SIZE_UNIT (pchar_type_node)); 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); @@ -1641,7 +1641,7 @@ build_dt (tree function, gfc_code * code) tree tmp, var; gfc_expr *nmlname; gfc_namelist *nml; - unsigned int mask = 0; + unsigned int mask = IOPARM_dt_f2003; gfc_start_block (&block); gfc_init_block (&post_block); |