aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-io.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2006-08-15 23:03:28 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2006-08-15 23:03:28 +0000
commit014ec6ee5fcb77e38dca4a6f272349f4859b03c5 (patch)
tree69155a97cbe4b81569cdabce8b9f3f44a1536d34 /gcc/fortran/trans-io.c
parent55af93a8a3f04d7a1953fafba7d7e169754cb863 (diff)
downloadgcc-014ec6ee5fcb77e38dca4a6f272349f4859b03c5.zip
gcc-014ec6ee5fcb77e38dca4a6f272349f4859b03c5.tar.gz
gcc-014ec6ee5fcb77e38dca4a6f272349f4859b03c5.tar.bz2
re PR fortran/25828 ([f2003] ACCESS='STREAM' io support)
2006-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/25828 * gfortran.h: Add new pointer for stream position to st_inquire. Rename gfc_large_io_int_kind to gfc_intio_kind. * trans-types.c (gfc_init_kinds): use gfc_intio_kind. * io.c: Add new IO tag for file position going in and another for out. (match_dt_element): Match new tag_spos. (gfc_resolve_dt): Resolve new tag_spos. (gfc_free_inquire): Free inquire->strm_pos. (match_inquire_element): Match new tag_strm_out. (gfc_resolve_inquire): Resolve new tag_strm_out. * trans-io.c: Rename IOPARM_type_large_io_int to IOPARM_type_intio. (gfc_build_st_parameter): Same. (gfc_build_io_library_fndecls) Same. and add build pointer type pintio. (gfc_trans_inquire): Translate strm_pos for inquire. * ioparm.def: Reorder flags to accomodate addition of new inquire flag for strm_pos_out and add it in. From-SVN: r116171
Diffstat (limited to 'gcc/fortran/trans-io.c')
-rw-r--r--gcc/fortran/trans-io.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 2c8e3e6..4fb1983 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -35,7 +35,6 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "trans-types.h"
#include "trans-const.h"
-
/* Members of the ioparm structure. */
enum ioparam_type
@@ -52,8 +51,9 @@ enum ioparam_type
enum iofield_type
{
IOPARM_type_int4,
- IOPARM_type_large_io_int,
+ IOPARM_type_intio,
IOPARM_type_pint4,
+ IOPARM_type_pintio,
IOPARM_type_pchar,
IOPARM_type_parray,
IOPARM_type_pad,
@@ -169,8 +169,9 @@ gfc_build_st_parameter (enum ioparam_type ptype, tree *types)
switch (p->type)
{
case IOPARM_type_int4:
- case IOPARM_type_large_io_int:
+ case IOPARM_type_intio:
case IOPARM_type_pint4:
+ case IOPARM_type_pintio:
case IOPARM_type_parray:
case IOPARM_type_pchar:
case IOPARM_type_pad:
@@ -216,16 +217,18 @@ void
gfc_build_io_library_fndecls (void)
{
tree types[IOPARM_type_num], pad_idx, gfc_int4_type_node;
- tree gfc_large_io_int_type_node;
+ tree gfc_intio_type_node;
tree parm_type, dt_parm_type;
tree gfc_c_int_type_node;
HOST_WIDE_INT pad_size;
enum ioparam_type ptype;
types[IOPARM_type_int4] = gfc_int4_type_node = gfc_get_int_type (4);
- types[IOPARM_type_large_io_int] = gfc_large_io_int_type_node
- = gfc_get_int_type (gfc_large_io_int_kind);
+ types[IOPARM_type_intio] = gfc_intio_type_node
+ = gfc_get_int_type (gfc_intio_kind);
types[IOPARM_type_pint4] = build_pointer_type (gfc_int4_type_node);
+ types[IOPARM_type_pintio]
+ = 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));
@@ -1098,6 +1101,10 @@ gfc_trans_inquire (gfc_code * code)
mask |= set_string (&block, &post_block, var, IOPARM_inquire_convert,
p->convert);
+ if (p->strm_pos)
+ mask |= set_parameter_ref (&block, &post_block, var,
+ IOPARM_inquire_strm_pos_out, p->strm_pos);
+
set_parameter_const (&block, var, IOPARM_common_flags, mask);
tmp = build_fold_addr_expr (var);