2006-03-25 Thomas Koenig <Thomas.Koenig@online.de>
+ PR libfortran/26735
+ * gfortran.dg/convert_implied_open.f90: New test case.
+
+2006-03-25 Thomas Koenig <Thomas.Koenig@online.de>
+
PR fortran/26769
* gfortran.dg/transpose_reshape_r10.f90: New test case.
--- /dev/null
+! { dg-do run }
+! { dg-options "-fconvert=swap" }
+! PR 26735 - implied open didn't use to honor -fconvert
+program main
+ implicit none
+ integer (kind=8) :: i1, i2, i3
+ write (10) 1_8
+ close (10)
+ open (10, form="unformatted", access="direct", recl=8)
+ read (10,rec=1) i1
+ read (10,rec=2) i2
+ read (10,rec=3) i3
+ if (i1 /= 8 .or. i2 /= 1 .or. i3 /= 8) call abort
+ close (10,status="delete")
+end program main
2006-03-25 Thomas Koenig <Thomas.Koenig@online.de>
+ PR libfortran/26735
+ * io/transfer.c (data_transfer_init): Set u_flags.convert
+ on an unopened unit if specified by environment variable
+ (via get_unformatted_convert) or by compile-time option.
+
+2006-03-25 Thomas Koenig <Thomas.Koenig@online.de>
+
PR fortran/26769
* Makefile.am: Add transpose_r10.c and reshape_r10.c.
* aclocal.m4: Regenerate using aclocal 1.9.3.
if (dtp->u.p.current_unit->s == NULL)
{ /* Open the unit with some default flags. */
st_parameter_open opp;
+ unit_convert conv;
+
if (dtp->common.unit < 0)
{
close_unit (dtp->u.p.current_unit);
u_flags.blank = BLANK_UNSPECIFIED;
u_flags.pad = PAD_UNSPECIFIED;
u_flags.status = STATUS_UNKNOWN;
+
+ conv = get_unformatted_convert (dtp->common.unit);
+
+ if (conv == CONVERT_NONE)
+ conv = compile_options.convert;
+
+ /* We use l8_to_l4_offset, which is 0 on little-endian machines
+ and 1 on big-endian machines. */
+ switch (conv)
+ {
+ case CONVERT_NATIVE:
+ case CONVERT_SWAP:
+ break;
+
+ case CONVERT_BIG:
+ conv = l8_to_l4_offset ? CONVERT_NATIVE : CONVERT_SWAP;
+ break;
+
+ case CONVERT_LITTLE:
+ conv = l8_to_l4_offset ? CONVERT_SWAP : CONVERT_NATIVE;
+ break;
+
+ default:
+ internal_error (&opp.common, "Illegal value for CONVERT");
+ break;
+ }
+
+ u_flags.convert = conv;
+
opp.common = dtp->common;
opp.common.flags &= IOPARM_COMMON_MASK;
dtp->u.p.current_unit = new_unit (&opp, dtp->u.p.current_unit, &u_flags);