This is the mail archive of the mailing list for the GNU Fortran project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] I/O of arrays with 7 < rank <= 15


recently the number of supported ranks was increased from 7 to 15 for Fortran 2008. The front-end can now handle rank 15 arrays, but for doing I/O only rank 7 arrays are possible, e.g. print *, largearray(:, :, :, :, :, :, :, eight) [where largearray itself is a rank 8 array]. (cf. PR 36825).

The restriction for the library comes from libgfortran.h:

#define GFC_DTYPE_RANK_MASK 0x07  // = 111 in binary notation
#define GFC_DTYPE_TYPE_SHIFT 3 // the three bits from above
#define GFC_DTYPE_TYPE_MASK 0x38

which are used as written in trans-types.c:

  The dtype member is formatted as follows:
   rank = dtype & GFC_DTYPE_RANK_MASK // 3 bits
   type = (dtype & GFC_DTYPE_TYPE_MASK) >> GFC_DTYPE_TYPE_SHIFT // 3 bits
   size = dtype >> GFC_DTYPE_SIZE_SHIFT

I could now change 0x07 into 0x0F (= 15 decimal = 1111 binary) [and adapt GFC_DTYPE_TYPE_SHIFT and GFC_DTYPE_SIZE_SHIFT]. However, I believe this will break the compatibility between GCC 4.3 and GCC 4.4

(In the library, dtype is of the type ssize_t thus we should have (on most systems?) at least 32 bits available. That should be no problem.)

The question is now: How to change this without breaking backward compatibility with 4.3 programs. "dtype" is used all over the place and I do not see any method to make use of versioned symbols. (Well, other than copying half of the library to provide access to the new dtype.)

Ideas? Or have I missed something and there is not problem in terms of compatibility?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]