Daniel Franke - Re: [patch, fortran] fixes for the EXIT intrinsic function (PR30933) (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC 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]

On Saturday 24 February 2007 13:29:36 Tobias Burnus wrote:

Hi,

Steve Kargl wrote:

Unfortunately, no. You're looking at a merging of different novice contributions to gfortran. I wrote some of the g77 intrinsics to cut my teeth, and then FX wrote several more g77 intrinsics as his intrduction to gfortran. Others contributed intrinsics in the dark ages when gfortran only worried about integer(4) and (8).

In any case which of the following option should we choose for those non-time critical functions which call C library functions? Currently, we have a mixure of (i), and (iv).

i. Add i1, i2, and i16 versions to libgfortran

ii. Convert kind > 8 to integer(8) and kind < 4 to integer(4)

iii. As POSIX defines "exit(int)" and sizeof(int) is on most systems "4" convert everything to integer(4)

iv. Convert everything to the default integer, i.e. integer(4) or integer(8) depending whether -fdefault-integer-8 is used.

While (iv) is the easiest, it somehow looks a bit arbitrary. I therefore would prefer either of (i) to (iii), with (iii) seeming to be the cleanest - at least if one uses the same kind as the C library does. (How does one ensure this?)

Additional question:

If a subroutine/function takes multiple integer arguments, how many calls should be considered valid?

a) all possible combinations (i1/i1, i1/i2, i1/i4, ..., i8/i4, i8/i8) b) only those with matching types (i1/i1, i2/i2, i4/i4, i8/i8)

Daniel

P.S. Removed gcc-patches as recipient, this is fortran-only.


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