aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2006-07-24 00:19:45 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2006-07-24 00:19:45 +0000
commit4fec64b07b9da385b80e89f86c603cb13c90c56c (patch)
treecafb4ddf881a103f1c23303872bd9960d3b3d653
parent566ffce8955401e87e86899239f5bb0a6a5b6b0f (diff)
downloadgcc-4fec64b07b9da385b80e89f86c603cb13c90c56c.zip
gcc-4fec64b07b9da385b80e89f86c603cb13c90c56c.tar.gz
gcc-4fec64b07b9da385b80e89f86c603cb13c90c56c.tar.bz2
re PR libfortran/25289 (Cannot handle record numbers large than huge(0_4))
2006-07-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/25289 * gfortran.h: Declare gfc_large_io_int_kind. * trans-types.c (gfc_init_kinds): Set gfc_large_io_int_kind to size 8 or 4. * trans-io.c (enum iofield_type): Add large_io_int type. (gfc_build_st_parameter): Same. (gfc_build_io_library_fndecls): Same. * ioparm_def: Use large_io_int to define rec. From-SVN: r115700
-rw-r--r--gcc/fortran/ChangeLog13
-rw-r--r--gcc/fortran/gfortran.h1
-rw-r--r--gcc/fortran/ioparm.def2
-rw-r--r--gcc/fortran/trans-io.c5
-rw-r--r--gcc/fortran/trans-types.c15
5 files changed, 34 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 13ba611..df09fcb 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,6 +1,17 @@
+2006-07-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/25289
+ * gfortran.h: Declare gfc_large_io_int_kind.
+ * trans-types.c (gfc_init_kinds): Set gfc_large_io_int_kind
+ to size 8 or 4.
+ * trans-io.c (enum iofield_type): Add large_io_int type.
+ (gfc_build_st_parameter): Same.
+ (gfc_build_io_library_fndecls): Same.
+ * ioparm_def: Use large_io_int to define rec.
+
2006-07-22 Steven Bosscher <steven@gcc.gnu.org>
- PR fortran/28439
+ PR fortran/28439
* trans-stmt.c (gfc_trans_arithmetic_if): Evaluate the condition once.
2006-07-16 Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 21b0d09..37d70f3 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1806,6 +1806,7 @@ extern int gfc_default_character_kind;
extern int gfc_default_logical_kind;
extern int gfc_default_complex_kind;
extern int gfc_c_int_kind;
+extern int gfc_large_io_int_kind;
/* symbol.c */
void gfc_clear_new_implicit (void);
diff --git a/gcc/fortran/ioparm.def b/gcc/fortran/ioparm.def
index 0fe9a7b..977e4f0 100644
--- a/gcc/fortran/ioparm.def
+++ b/gcc/fortran/ioparm.def
@@ -58,7 +58,7 @@ IOPARM (inquire, convert, 1 << 29, char1)
#define IOPARM_dt_namelist_read_mode (1 << 8)
#endif
IOPARM (dt, common, 0, common)
-IOPARM (dt, rec, 1 << 9, int4)
+IOPARM (dt, rec, 1 << 9, large_io_int)
IOPARM (dt, size, 1 << 10, pint4)
IOPARM (dt, iolength, 1 << 11, pint4)
IOPARM (dt, internal_unit_desc, 0, parray)
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 70b9368..2c8e3e6 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -52,6 +52,7 @@ enum ioparam_type
enum iofield_type
{
IOPARM_type_int4,
+ IOPARM_type_large_io_int,
IOPARM_type_pint4,
IOPARM_type_pchar,
IOPARM_type_parray,
@@ -168,6 +169,7 @@ 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_pint4:
case IOPARM_type_parray:
case IOPARM_type_pchar:
@@ -214,12 +216,15 @@ 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 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_pint4] = build_pointer_type (gfc_int4_type_node);
types[IOPARM_type_parray] = pchar_type_node;
types[IOPARM_type_pchar] = pchar_type_node;
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 7c48150..4d20b83 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -93,6 +93,10 @@ int gfc_default_logical_kind;
int gfc_default_complex_kind;
int gfc_c_int_kind;
+/* The kind size used for record offsets. If the target system supports
+ kind=8, this will be set to 8, otherwise it is set to 4. */
+int gfc_large_io_int_kind;
+
/* Query the target to determine which machine modes are available for
computation. Choose KIND numbers for them. */
@@ -140,6 +144,17 @@ gfc_init_kinds (void)
i_index += 1;
}
+ /* Set the kind used to match GFC_LARGE_IO_INT in libgfortran. This is
+ used for large file access. */
+
+ if (saw_i8)
+ gfc_large_io_int_kind = 8;
+ else
+ gfc_large_io_int_kind = 4;
+
+ /* If we do not at least have kind = 4, everything is pointless. */
+ gcc_assert(saw_i4);
+
/* Set the maximum integer kind. Used with at least BOZ constants. */
gfc_max_integer_kind = gfc_integer_kinds[i_index - 1].kind;