This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[Fwd: Question on PR25289]
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Date: Tue, 11 Jul 2006 19:23:36 -0700
- Subject: [Fwd: Question on PR25289]
I did not here back from Thomas on this so I am going to list here. The
attached patch appears to do the trick. If there are no further objections, I
would like to commit this to 4.2 only. I have been running this for a while
with no problems observed.
Jerry
-------- Original Message --------
Thomas,
Attached is the latest version of the large file io patch. Steve Kargl looked
at it. We have one question. What, if any, problems do we have on a system
that does not support GFC_INTEGER_8? Are there any such systems?
Do you see any issues with the record_marker size options?
Let me know if you can test on such a system or whether you have any suggestions
on who might if you can not.
Thanks and best regards.
Jerry
Index: gcc/fortran/gfortran.h
===================================================================
*** gcc/fortran/gfortran.h (revision 115062)
--- gcc/fortran/gfortran.h (working copy)
*************** extern int gfc_default_character_kind;
*** 1806,1811 ****
--- 1806,1812 ----
extern int gfc_default_logical_kind;
extern int gfc_default_complex_kind;
extern int gfc_c_int_kind;
+ extern int gfc_record_int_kind;
/* symbol.c */
void gfc_clear_new_implicit (void);
Index: gcc/fortran/trans-types.c
===================================================================
*** gcc/fortran/trans-types.c (revision 115062)
--- gcc/fortran/trans-types.c (working copy)
*************** int gfc_default_logical_kind;
*** 93,98 ****
--- 93,102 ----
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_record_int_kind;
+
/* Query the target to determine which machine modes are available for
computation. Choose KIND numbers for them. */
*************** gfc_init_kinds (void)
*** 125,133 ****
kind = bitsize / 8;
if (kind == 4)
! saw_i4 = true;
if (kind == 8)
! saw_i8 = true;
gfc_integer_kinds[i_index].kind = kind;
gfc_integer_kinds[i_index].radix = 2;
--- 129,143 ----
kind = bitsize / 8;
if (kind == 4)
! {
! saw_i4 = true;
! gfc_record_int_kind = 4;
! }
if (kind == 8)
! {
! saw_i8 = true;
! gfc_record_int_kind = 8;
! }
gfc_integer_kinds[i_index].kind = kind;
gfc_integer_kinds[i_index].radix = 2;
Index: gcc/fortran/trans-io.c
===================================================================
*** gcc/fortran/trans-io.c (revision 115062)
--- gcc/fortran/trans-io.c (working copy)
*************** enum ioparam_type
*** 52,57 ****
--- 52,58 ----
enum iofield_type
{
IOPARM_type_int4,
+ IOPARM_type_intoff,
IOPARM_type_pint4,
IOPARM_type_pchar,
IOPARM_type_parray,
*************** gfc_build_st_parameter (enum ioparam_typ
*** 168,173 ****
--- 169,175 ----
switch (p->type)
{
case IOPARM_type_int4:
+ case IOPARM_type_intoff:
case IOPARM_type_pint4:
case IOPARM_type_parray:
case IOPARM_type_pchar:
*************** void
*** 214,225 ****
--- 216,230 ----
gfc_build_io_library_fndecls (void)
{
tree types[IOPARM_type_num], pad_idx, gfc_int4_type_node;
+ tree gfc_intoff_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_intoff] = gfc_intoff_type_node
+ = gfc_get_int_type (gfc_record_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;
Index: gcc/fortran/ioparm.def
===================================================================
*** gcc/fortran/ioparm.def (revision 115062)
--- gcc/fortran/ioparm.def (working copy)
*************** IOPARM (inquire, convert, 1 << 29,
*** 58,64 ****
#define IOPARM_dt_namelist_read_mode (1 << 8)
#endif
IOPARM (dt, common, 0, common)
! IOPARM (dt, rec, 1 << 9, int4)
IOPARM (dt, size, 1 << 10, pint4)
IOPARM (dt, iolength, 1 << 11, pint4)
IOPARM (dt, internal_unit_desc, 0, parray)
--- 58,64 ----
#define IOPARM_dt_namelist_read_mode (1 << 8)
#endif
IOPARM (dt, common, 0, common)
! IOPARM (dt, rec, 1 << 9, intoff)
IOPARM (dt, size, 1 << 10, pint4)
IOPARM (dt, iolength, 1 << 11, pint4)
IOPARM (dt, internal_unit_desc, 0, parray)
Index: libgfortran/libgfortran.h
===================================================================
*** libgfortran/libgfortran.h (revision 115047)
--- libgfortran/libgfortran.h (working copy)
*************** Boston, MA 02110-1301, USA. */
*** 56,62 ****
--- 56,69 ----
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+
+ #if defined (HAVE_GFC_INTEGER_8)
+ typedef GFC_INTEGER_8 gfc_offset;
+ #elseif (HAVE_GFC_INTEGER_4)
+ typedef GFC_INTEGER_4 gfc_offset;
+ #else
typedef off_t gfc_offset;
+ #endif
#ifndef NULL
#define NULL (void *) 0
Index: libgfortran/io/io.h
===================================================================
*** libgfortran/io/io.h (revision 115047)
--- libgfortran/io/io.h (working copy)
*************** struct format_data;
*** 355,361 ****
typedef struct st_parameter_dt
{
st_parameter_common common;
! GFC_INTEGER_4 rec;
GFC_INTEGER_4 *size, *iolength;
gfc_array_char *internal_unit_desc;
CHARACTER1 (format);
--- 355,361 ----
typedef struct st_parameter_dt
{
st_parameter_common common;
! gfc_offset rec;
GFC_INTEGER_4 *size, *iolength;
gfc_array_char *internal_unit_desc;
CHARACTER1 (format);