diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2008-06-15 17:51:03 +0000 |
---|---|---|
committer | H.J. Lu <hongjiu.lu@intel.com> | 2008-06-15 17:51:03 +0000 |
commit | 2875fdf45b28d9d487a80df51854cb288f2a8c61 (patch) | |
tree | 255a026e396332a5b82736063f58cc379243ba34 /gcc/fortran | |
parent | 538cec38b518593928cb9557e918f74597961608 (diff) |
Merged with trunk at revision 136811.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/stack@136812 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 21 | ||||
-rw-r--r-- | gcc/fortran/gfc-internals.texi | 2 | ||||
-rw-r--r-- | gcc/fortran/gfortran.texi | 12 | ||||
-rw-r--r-- | gcc/fortran/intrinsic.texi | 260 | ||||
-rw-r--r-- | gcc/fortran/invoke.texi | 4 | ||||
-rw-r--r-- | gcc/fortran/trans-io.c | 31 |
7 files changed, 189 insertions, 162 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e42da2f1e91..82ca881e7bb 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,24 @@ +2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + * gfc-internals.texi: Expand TABs, drop indentation outside examples. + * gfortran.texi: Likewise. + * intrinsic.texi: Likewise. + * invoke.texi: Likewise. + +2008-06-13 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/35863 + * trans-io.c (gfc_build_io_library_fndecls): Build declaration for + transfer_character_wide which includes passing in the character kind to + support wide character IO. (transfer_expr): If the kind == 4, create the + argument and build the call. + * gfortran.texi: Fix typo. + +2008-06-13 Tobias Burnus <burnus@net-b.de> + + PR fortran/36476 + * decl.c (do_parm): Handle init expression for len=*. + 2008-06-12 Tobias Burnus <burnus@net-b.de> PR fortran/36462 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index c4ef7e7004d..a1c7d5aa44e 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -5820,10 +5820,27 @@ do_parm (void) && sym->ts.cl->length != NULL && sym->ts.cl->length->expr_type == EXPR_CONSTANT && init->expr_type == EXPR_CONSTANT - && init->ts.type == BT_CHARACTER - && init->ts.kind == 1) + && init->ts.type == BT_CHARACTER) gfc_set_constant_character_len ( mpz_get_si (sym->ts.cl->length->value.integer), init, false); + else if (sym->ts.type == BT_CHARACTER && sym->ts.cl != NULL + && sym->ts.cl->length == NULL) + { + int clen; + if (init->expr_type == EXPR_CONSTANT) + { + clen = init->value.character.length; + sym->ts.cl->length = gfc_int_expr (clen); + } + else if (init->expr_type == EXPR_ARRAY) + { + gfc_expr *p = init->value.constructor->expr; + clen = p->value.character.length; + sym->ts.cl->length = gfc_int_expr (clen); + } + else if (init->ts.cl && init->ts.cl->length) + sym->ts.cl->length = gfc_copy_expr (sym->value->ts.cl->length); + } sym->value = init; return MATCH_YES; diff --git a/gcc/fortran/gfc-internals.texi b/gcc/fortran/gfc-internals.texi index f693aa9a72d..0a91310fe7d 100644 --- a/gcc/fortran/gfc-internals.texi +++ b/gcc/fortran/gfc-internals.texi @@ -121,7 +121,7 @@ not accurately reflect the status of the most recent GNU Fortran compiler. Data structures used by the frontend * LibGFortran:: The LibGFortran Runtime Library. * GNU Free Documentation License:: - How you can copy and share this manual. + How you can copy and share this manual. * Index:: Index of this documentation. @end menu @end ifnottex diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index c47f22fcfa0..cf90ceda833 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -190,7 +190,7 @@ Part II: Language Reference * Copying:: GNU General Public License says how you can copy and share GNU Fortran. * GNU Free Documentation License:: - How you can copy and share this manual. + How you can copy and share this manual. * Funding:: How to help assure continued work for free software. * Option Index:: Index of command line options * Keyword Index:: Index of concepts @@ -229,7 +229,7 @@ or alternative to, the unix @command{f95} command; * Preprocessing and conditional compilation:: The Fortran preprocessor * GNU Fortran and G77:: Why we chose to start from scratch. * Project Status:: Status of GNU Fortran, roadmap, proposed extensions. -* Standards:: Standards supported by GNU Fortran. +* Standards:: Standards supported by GNU Fortran. @end menu @@ -525,7 +525,7 @@ support is reported in the @ref{Fortran 2003 status} section of the documentation. The next version of the Fortran standard after Fortran 2003 is currently -being developped and the GNU Fortran compiler supports some of its new +being developed and the GNU Fortran compiler supports some of its new features. This support is based on the latest draft of the standard (available from @url{http://www.nag.co.uk/sc22wg5/}) and no guarantee of future compatibility is made, as the final standard might differ from the @@ -693,7 +693,7 @@ the modes are the same as for the @code{CONVERT} specifier: @item @code{NATIVE} Use the native format. This is the default. @item @code{SWAP} Swap between little- and big-endian. @item @code{LITTLE_ENDIAN} Use the little-endian format - for unformatted files. +for unformatted files. @item @code{BIG_ENDIAN} Use the big-endian format for unformatted files. @end itemize A missing mode for an exception is taken to mean @code{BIG_ENDIAN}. @@ -1415,9 +1415,9 @@ Valid values for @code{CONVERT} are: @item @code{CONVERT='NATIVE'} Use the native format. This is the default. @item @code{CONVERT='SWAP'} Swap between little- and big-endian. @item @code{CONVERT='LITTLE_ENDIAN'} Use the little-endian representation - for unformatted files. +for unformatted files. @item @code{CONVERT='BIG_ENDIAN'} Use the big-endian representation for - unformatted files. +unformatted files. @end itemize Using the option could look like this: diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index ee358501bed..db336bfcd92 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -489,8 +489,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{I} @tab The type shall be @code{INTEGER}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -789,8 +788,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{A} @tab The type of the argument shall be @code{REAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -1059,8 +1057,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{A} @tab The type of the argument shall be @code{REAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -2004,9 +2001,9 @@ Subroutine @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{CPTR} @tab scalar of the type @code{C_FUNPTR}. It is - @code{INTENT(IN)}. +@code{INTENT(IN)}. @item @var{FPTR} @tab procedure pointer interoperable with @var{cptr}. It is - @code{INTENT(OUT)}. +@code{INTENT(OUT)}. @end multitable @item @emph{Example}: @@ -2062,13 +2059,13 @@ Subroutine @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{CPTR} @tab scalar of the type @code{C_PTR}. It is - @code{INTENT(IN)}. +@code{INTENT(IN)}. @item @var{FPTR} @tab pointer interoperable with @var{cptr}. It is - @code{INTENT(OUT)}. +@code{INTENT(OUT)}. @item @var{SHAPE} @tab (Optional) Rank-one array of type @code{INTEGER} - with @code{INTENT(IN)}. It shall be present - if and only if @var{fptr} is an array. The size - must be equal to the rank of @var{fptr}. +with @code{INTENT(IN)}. It shall be present +if and only if @var{fptr} is an array. The size +must be equal to the rank of @var{fptr}. @end multitable @item @emph{Example}: @@ -2115,8 +2112,7 @@ Inquiry function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{X} @tab Associated scalar pointer or interoperable scalar - or allocated allocatable variable with @code{TARGET} - attribute. +or allocated allocatable variable with @code{TARGET} attribute. @end multitable @item @emph{Return value}: @@ -2213,8 +2209,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{A} @tab The type shall be @code{REAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -2260,8 +2255,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{I} @tab The type shall be @code{INTEGER}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -2315,11 +2309,10 @@ Subroutine, function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{NAME} @tab The type shall be @code{CHARACTER} of default - kind and shall specify a valid path within the - file system. +kind and shall specify a valid path within the file system. @item @var{STATUS} @tab (Optional) @code{INTEGER} status flag of the default - kind. Returns 0 on success, and a system specific - and nonzero error code otherwise. +kind. Returns 0 on success, and a system specific and nonzero error code +otherwise. @end multitable @item @emph{Example}: @@ -2434,13 +2427,11 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{X} @tab The type may be @code{INTEGER}, @code{REAL}, - or @code{COMPLEX}. +or @code{COMPLEX}. @item @var{Y} @tab (Optional; only allowed if @var{X} is not - @code{COMPLEX}.) May be @code{INTEGER} - or @code{REAL}. +@code{COMPLEX}.) May be @code{INTEGER} or @code{REAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -2750,8 +2741,7 @@ Transformational function @item @var{MASK} @tab The type shall be @code{LOGICAL}. @item @var{DIM} @tab (Optional) The type shall be @code{INTEGER}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -2928,7 +2918,7 @@ Subroutine, function @multitable @columnfractions .15 .70 @item @var{TIME} @tab The type shall be of type @code{INTEGER(KIND=8)}. @item @var{RESULT} @tab The type shall be of type @code{CHARACTER} and - of default kind. +of default kind. @end multitable @item @emph{Return value}: @@ -2982,7 +2972,7 @@ Unavailable time and date parameters return blanks. @item @tab @code{VALUE(6)}: @tab The minutes of the hour @item @tab @code{VALUE(7)}: @tab The seconds of the minute @item @tab @code{VALUE(8)}: @tab The milliseconds of the second -@end multitable +@end multitable @item @emph{Standard}: Fortran 95 and later @@ -2996,11 +2986,11 @@ Subroutine @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{DATE} @tab (Optional) The type shall be @code{CHARACTER(LEN=8)} - or larger, and of default kind. +or larger, and of default kind. @item @var{TIME} @tab (Optional) The type shall be @code{CHARACTER(LEN=10)} - or larger, and of default kind. +or larger, and of default kind. @item @var{ZONE} @tab (Optional) The type shall be @code{CHARACTER(LEN=5)} - or larger, and of default kind. +or larger, and of default kind. @item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}. @end multitable @@ -3051,7 +3041,7 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{A} @tab The type shall be @code{INTEGER}, @code{REAL}, - or @code{COMPLEX}. +or @code{COMPLEX}. @end multitable @item @emph{Return value}: @@ -3098,9 +3088,9 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{X} @tab The type may be @code{INTEGER}, @code{REAL}, - or @code{COMPLEX}. +or @code{COMPLEX}. @item @var{Y} @tab (Optional if @var{X} is not @code{COMPLEX}.) May be - @code{INTEGER} or @code{REAL}. +@code{INTEGER} or @code{REAL}. @end multitable @item @emph{Return value}: @@ -4060,10 +4050,10 @@ Subroutine, function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{C} @tab The type shall be @code{CHARACTER} and of default - kind. +kind. @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. - Returns 0 on success, -1 on end-of-file, and a - system specific positive error code otherwise. +Returns 0 on success, -1 on end-of-file, and a system specific positive +error code otherwise. @end multitable @item @emph{Example}: @@ -4123,10 +4113,10 @@ Subroutine, function @multitable @columnfractions .15 .70 @item @var{UNIT} @tab The type shall be @code{INTEGER}. @item @var{C} @tab The type shall be @code{CHARACTER} and of default - kind. +kind. @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. - Returns 0 on success, -1 on end-of-file and a - system specific positive error code otherwise. +Returns 0 on success, -1 on end-of-file and a system specific positive +error code otherwise. @end multitable @item @emph{Example}: @@ -4174,8 +4164,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{A} @tab The type shall be @code{REAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -4305,10 +4294,10 @@ Subroutine, function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{C} @tab The type shall be @code{CHARACTER} and of default - kind. +kind. @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. - Returns 0 on success, -1 on end-of-file and a - system specific positive error code otherwise. +Returns 0 on success, -1 on end-of-file and a system specific positive +error code otherwise. @end multitable @item @emph{Example}: @@ -4362,10 +4351,10 @@ Subroutine, function @multitable @columnfractions .15 .70 @item @var{UNIT} @tab The type shall be @code{INTEGER}. @item @var{C} @tab The type shall be @code{CHARACTER} and of default - kind. +kind. @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. - Returns 0 on success, -1 on end-of-file and a - system specific positive error code otherwise. +Returns 0 on success, -1 on end-of-file and a system specific positive +error code otherwise. @end multitable @item @emph{Example}: @@ -4581,7 +4570,7 @@ Subroutine, function @item @var{UNIT} @tab An open I/O unit number of type @code{INTEGER}. @item @var{BUFF} @tab The type shall be @code{INTEGER(4), DIMENSION(13)}. @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER(4)}. Returns 0 - on success and a system specific error code otherwise. +on success and a system specific error code otherwise. @end multitable @item @emph{Example}: @@ -4873,9 +4862,9 @@ Subroutine @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{NUMBER} @tab Shall be a scalar of type @code{INTEGER(4)}, - @math{@var{NUMBER} \geq 0} +@math{@var{NUMBER} \geq 0} @item @var{VALUE} @tab Shall be a scalar of type @code{CHARACTER} - and of default kind. +and of default kind. @item @var{LENGTH} @tab (Option) Shall be a scalar of type @code{INTEGER(4)}. @item @var{STATUS} @tab (Option) Shall be a scalar of type @code{INTEGER(4)}. @end multitable @@ -4939,7 +4928,7 @@ Subroutine, function @multitable @columnfractions .15 .70 @item @var{C} @tab The type shall be @code{CHARACTER} and of default kind. @item @var{STATUS} @tab (Optional) status flag. Returns 0 on success, - a system specific and nonzero error code otherwise. +a system specific and nonzero error code otherwise. @end multitable @item @emph{Example}: @@ -5231,17 +5220,16 @@ Subroutine @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{TIME} @tab An @code{INTEGER} scalar expression - corresponding to a system time, with - @code{INTENT(IN)}. +corresponding to a system time, with @code{INTENT(IN)}. @item @var{VALUES} @tab A default @code{INTEGER} array with 9 elements, - with @code{INTENT(OUT)}. +with @code{INTENT(OUT)}. @end multitable @item @emph{Return value}: The elements of @var{VALUES} are assigned as follows: @enumerate @item Seconds after the minute, range 0--59 or 0--61 to allow for leap - seconds +seconds @item Minutes after the hour, range 0--59 @item Hours past midnight, range 0--23 @item Day of month, range 0--31 @@ -5250,8 +5238,7 @@ The elements of @var{VALUES} are assigned as follows: @item Number of days since Sunday, range 0--6 @item Days since January 1 @item Daylight savings indicator: positive if daylight savings is in - effect, zero if not, and negative if the information is not - available. +effect, zero if not, and negative if the information is not available. @end enumerate @item @emph{See also}: @@ -5289,8 +5276,7 @@ Subroutine, function @multitable @columnfractions .15 .70 @item @var{C} @tab Shall of type @code{CHARACTER} and of default kind. @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. - Returns 0 on success, or a system specific error - code otherwise. +Returns 0 on success, or a system specific error code otherwise. @end multitable @item @emph{Return value}: @@ -5405,8 +5391,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)} @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -5662,8 +5647,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)} @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -5856,8 +5840,7 @@ Elemental function @item @var{BACK} @tab (Optional) Shall be a scalar @code{LOGICAL}, with @code{INTENT(IN)} @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -5893,10 +5876,9 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{A} @tab Shall be of type @code{INTEGER}, - @code{REAL}, or @code{COMPLEX}. +@code{REAL}, or @code{COMPLEX}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -5961,7 +5943,7 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{A} @tab Shall be of type @code{INTEGER}, - @code{REAL}, or @code{COMPLEX}. +@code{REAL}, or @code{COMPLEX}. @end multitable @item @emph{Return value}: @@ -5996,7 +5978,7 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{A} @tab Shall be of type @code{INTEGER}, - @code{REAL}, or @code{COMPLEX}. +@code{REAL}, or @code{COMPLEX}. @end multitable @item @emph{Return value}: @@ -6428,8 +6410,8 @@ Subroutine, function @item @var{VALUE} @tab Shall be a scalar @code{INTEGER}, with @code{INTENT(IN)} @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER(4)} or - @code{INTEGER(8)}. Returns 0 on success, or a - system-specific error code otherwise. +@code{INTEGER(8)}. Returns 0 on success, or a system-specific error code +otherwise. @end multitable @item @emph{See also}: @@ -6504,8 +6486,7 @@ Inquiry function @item @var{ARRAY} @tab Shall be an array, of any type. @item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -6550,8 +6531,7 @@ Inquiry function @item @var{STRING} @tab Shall be a scalar or array of type @code{CHARACTER}, with @code{INTENT(IN)} @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -6587,8 +6567,7 @@ Elemental function @item @var{STRING} @tab Shall be a scalar of type @code{CHARACTER}, with @code{INTENT(IN)} @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -7085,8 +7064,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{L} @tab The type shall be @code{LOGICAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -7124,7 +7102,7 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{A} @tab Shall be of type @code{INTEGER}, - @code{REAL}, or @code{COMPLEX}. +@code{REAL}, or @code{COMPLEX}. @end multitable @item @emph{Return value}: @@ -7243,17 +7221,16 @@ Subroutine @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{STIME} @tab An @code{INTEGER} scalar expression - corresponding to a system time, with - @code{INTENT(IN)}. +corresponding to a system time, with @code{INTENT(IN)}. @item @var{TARRAY} @tab A default @code{INTEGER} array with 9 elements, - with @code{INTENT(OUT)}. +with @code{INTENT(OUT)}. @end multitable @item @emph{Return value}: The elements of @var{TARRAY} are assigned as follows: @enumerate @item Seconds after the minute, range 0--59 or 0--61 to allow for leap - seconds +seconds @item Minutes after the hour, range 0--59 @item Hours past midnight, range 0--23 @item Day of month, range 0--31 @@ -7262,8 +7239,7 @@ The elements of @var{TARRAY} are assigned as follows: @item Number of days since Sunday, range 0--6 @item Days since January 1 @item Daylight savings indicator: positive if daylight savings is in - effect, zero if not, and negative if the information is not - available. +effect, zero if not, and negative if the information is not available. @end enumerate @item @emph{See also}: @@ -7361,17 +7337,13 @@ Transformational function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{MATRIX_A} @tab An array of @code{INTEGER}, - @code{REAL}, @code{COMPLEX}, or - @code{LOGICAL} type, with a rank of - one or two. +@code{REAL}, @code{COMPLEX}, or @code{LOGICAL} type, with a rank of +one or two. @item @var{MATRIX_B} @tab An array of @code{INTEGER}, - @code{REAL}, or @code{COMPLEX} type if - @var{MATRIX_A} is of a numeric type; - otherwise, an array of @code{LOGICAL} - type. The rank shall be one or two, and the - first (or only) dimension of @var{MATRIX_B} - shall be equal to the last (or only) - dimension of @var{MATRIX_A}. +@code{REAL}, or @code{COMPLEX} type if @var{MATRIX_A} is of a numeric +type; otherwise, an array of @code{LOGICAL} type. The rank shall be one +or two, and the first (or only) dimension of @var{MATRIX_B} shall be +equal to the last (or only) dimension of @var{MATRIX_A}. @end multitable @item @emph{Return value}: @@ -7410,11 +7382,10 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{A1} @tab The type shall be @code{INTEGER} or - @code{REAL}. +@code{REAL}. @item @var{A2}, @var{A3}, ... @tab An expression of the same type and kind - as @var{A1}. (As a GNU extension, - arguments of different kinds are - permitted.) +as @var{A1}. (As a GNU extension, arguments of different kinds are +permitted.) @end multitable @item @emph{Return value}: @@ -7514,13 +7485,12 @@ Transformational function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{ARRAY} @tab Shall be an array of type @code{INTEGER}, - @code{REAL}, or @code{CHARACTER}. +@code{REAL}, or @code{CHARACTER}. @item @var{DIM} @tab (Optional) Shall be a scalar of type - @code{INTEGER}, with a value between one - and the rank of @var{ARRAY}, inclusive. It - may not be an optional dummy argument. +@code{INTEGER}, with a value between one and the rank of @var{ARRAY}, +inclusive. It may not be an optional dummy argument. @item @var{MASK} @tab Shall be an array of type @code{LOGICAL}, - and conformable with @var{ARRAY}. +and conformable with @var{ARRAY}. @end multitable @item @emph{Return value}: @@ -7571,13 +7541,12 @@ Transformational function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{ARRAY} @tab Shall be an array of type @code{INTEGER}, - @code{REAL}, or @code{CHARACTER}. +@code{REAL}, or @code{CHARACTER}. @item @var{DIM} @tab (Optional) Shall be a scalar of type - @code{INTEGER}, with a value between one - and the rank of @var{ARRAY}, inclusive. It - may not be an optional dummy argument. +@code{INTEGER}, with a value between one and the rank of @var{ARRAY}, +inclusive. It may not be an optional dummy argument. @item @var{MASK} @tab Shall be an array of type @code{LOGICAL}, - and conformable with @var{ARRAY}. +and conformable with @var{ARRAY}. @end multitable @item @emph{Return value}: @@ -7696,7 +7665,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{TSOURCE} @tab May be of any type. @item @var{FSOURCE} @tab Shall be of the same type and type parameters - as @var{TSOURCE}. +as @var{TSOURCE}. @item @var{MASK} @tab Shall be of type @code{LOGICAL}. @end multitable @@ -7733,11 +7702,10 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{A1} @tab The type shall be @code{INTEGER} or - @code{REAL}. +@code{REAL}. @item @var{A2}, @var{A3}, ... @tab An expression of the same type and kind - as @var{A1}. (As a GNU extension, - arguments of different kinds are - permitted.) +as @var{A1}. (As a GNU extension, arguments of different kinds are +permitted.) @end multitable @item @emph{Return value}: @@ -7828,13 +7796,12 @@ Transformational function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{ARRAY} @tab Shall be an array of type @code{INTEGER}, - @code{REAL}, or @code{CHARACTER}. +@code{REAL}, or @code{CHARACTER}. @item @var{DIM} @tab (Optional) Shall be a scalar of type - @code{INTEGER}, with a value between one - and the rank of @var{ARRAY}, inclusive. It - may not be an optional dummy argument. +@code{INTEGER}, with a value between one and the rank of @var{ARRAY}, +inclusive. It may not be an optional dummy argument. @item @var{MASK} @tab Shall be an array of type @code{LOGICAL}, - and conformable with @var{ARRAY}. +and conformable with @var{ARRAY}. @end multitable @item @emph{Return value}: @@ -7885,13 +7852,12 @@ Transformational function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{ARRAY} @tab Shall be an array of type @code{INTEGER}, - @code{REAL}, or @code{CHARACTER}. +@code{REAL}, or @code{CHARACTER}. @item @var{DIM} @tab (Optional) Shall be a scalar of type - @code{INTEGER}, with a value between one - and the rank of @var{ARRAY}, inclusive. It - may not be an optional dummy argument. +@code{INTEGER}, with a value between one and the rank of @var{ARRAY}, +inclusive. It may not be an optional dummy argument. @item @var{MASK} @tab Shall be an array of type @code{LOGICAL}, - and conformable with @var{ARRAY}. +and conformable with @var{ARRAY}. @end multitable @item @emph{Return value}: @@ -8049,9 +8015,9 @@ Subroutine @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{SRC} @tab @code{ALLOCATABLE}, @code{INTENT(INOUT)}, may be - of any type and kind. +of any type and kind. @item @var{DEST} @tab @code{ALLOCATABLE}, @code{INTENT(OUT)}, shall be - of the same type, kind and rank as @var{SRC} +of the same type, kind and rank as @var{SRC}. @end multitable @item @emph{Return value}: @@ -8102,7 +8068,7 @@ Elemental subroutine @item @var{FROMPOS} @tab The type shall be @code{INTEGER}. @item @var{LEN} @tab The type shall be @code{INTEGER}. @item @var{TO} @tab The type shall be @code{INTEGER}, of the - same kind as @var{FROM}. +same kind as @var{FROM}. @item @var{TOPOS} @tab The type shall be @code{INTEGER}. @end multitable @@ -8181,7 +8147,7 @@ Inquiry function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{C} @tab The argument shall be a scalar or array of the - type @code{CHARACTER}. +type @code{CHARACTER}. @end multitable @item @emph{Return value}: @@ -8222,8 +8188,7 @@ Elemental function @multitable @columnfractions .15 .70 @item @var{X} @tab The type of the argument shall be @code{REAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -8931,10 +8896,9 @@ Elemental function @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{X} @tab Shall be @code{INTEGER}, @code{REAL}, or - @code{COMPLEX}. +@code{COMPLEX}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -9257,8 +9221,7 @@ Elemental function @item @var{SET} @tab Shall be of type @code{CHARACTER}. @item @var{BACK} @tab (Optional) shall be of type @code{LOGICAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -9858,8 +9821,7 @@ a pointer it must be associated and allocatable arrays must be allocated. and its value shall be in the range from 1 to n, where n equals the rank of @var{ARRAY}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -10240,7 +10202,7 @@ Subroutine, function default kind and a valid path within the file system. @item @var{BUFF} @tab The type shall be @code{INTEGER(4), DIMENSION(13)}. @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER(4)}. Returns 0 - on success and a system specific error code otherwise. +on success and a system specific error code otherwise. @end multitable @item @emph{Example}: @@ -10888,8 +10850,7 @@ Inquiry function @item @var{ARRAY} @tab Shall be an array, of any type. @item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}. @item @var{KIND}@tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: @@ -10932,7 +10893,7 @@ Subroutine @multitable @columnfractions .15 .70 @item @var{MASK} @tab Shall be a scalar of type @code{INTEGER}. @item @var{MASK} @tab (Optional) Shall be a scalar of type - @code{INTEGER}. +@code{INTEGER}. @end multitable @end table @@ -11060,8 +11021,7 @@ Elemental function @item @var{SET} @tab Shall be of type @code{CHARACTER}. @item @var{BACK} @tab (Optional) shall be of type @code{LOGICAL}. @item @var{KIND} @tab (Optional) An @code{INTEGER} initialization - expression indicating the kind parameter of - the result. +expression indicating the kind parameter of the result. @end multitable @item @emph{Return value}: diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 1494c04013e..0879f52d7df 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -15,7 +15,7 @@ Invariant Sections being ``GNU General Public License'' and ``Funding Free Software'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the gfdl(7) man page. - + (a) The FSF's Front-Cover Text is: A GNU Manual @@ -36,7 +36,7 @@ gfortran [@option{-c}|@option{-S}|@option{-E}] [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}] [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] [@option{-f}@var{option}@dots{}] - [@option{-m}@var{machine-option}@dots{}] + [@option{-m}@var{machine-option}@dots{}] [@option{-o} @var{outfile}] @var{infile}@dots{} Only the most useful options are listed here; see below for the diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index 2f35002a5ac..f210169abe0 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -121,6 +121,7 @@ enum iocall IOCALL_X_INTEGER, IOCALL_X_LOGICAL, IOCALL_X_CHARACTER, + IOCALL_X_CHARACTER_WIDE, IOCALL_X_REAL, IOCALL_X_COMPLEX, IOCALL_X_ARRAY, @@ -327,6 +328,13 @@ gfc_build_io_library_fndecls (void) void_type_node, 3, dt_parm_type, pvoid_type_node, gfc_int4_type_node); + iocall[IOCALL_X_CHARACTER_WIDE] = + gfc_build_library_function_decl (get_identifier + (PREFIX("transfer_character_wide")), + void_type_node, 4, dt_parm_type, + pvoid_type_node, gfc_charlen_type_node, + gfc_int4_type_node); + iocall[IOCALL_X_REAL] = gfc_build_library_function_decl (get_identifier (PREFIX("transfer_real")), void_type_node, 3, dt_parm_type, @@ -1977,7 +1985,7 @@ transfer_array_component (tree expr, gfc_component * cm) static void transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, gfc_code * code) { - tree tmp, function, arg2, field, expr; + tree tmp, function, arg2, arg3, field, expr; gfc_component *c; int kind; @@ -2009,6 +2017,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, gfc_code * code) kind = ts->kind; function = NULL; arg2 = NULL; + arg3 = NULL; switch (ts->type) { @@ -2033,6 +2042,26 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, gfc_code * code) break; case BT_CHARACTER: + if (kind == 4) + { + if (se->string_length) + arg2 = se->string_length; + else + { + tmp = build_fold_indirect_ref (addr_expr); + gcc_assert (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE); + arg2 = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tmp))); + arg2 = fold_convert (gfc_charlen_type_node, arg2); + } + arg3 = build_int_cst (NULL_TREE, kind); + function = iocall[IOCALL_X_CHARACTER_WIDE]; + tmp = build_fold_addr_expr (dt_parm); + tmp = build_call_expr (function, 4, tmp, addr_expr, arg2, arg3); + gfc_add_expr_to_block (&se->pre, tmp); + gfc_add_block_to_block (&se->pre, &se->post); + return; + } + /* Fall through. */ case BT_HOLLERITH: if (se->string_length) arg2 = se->string_length; |