diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-04-03 21:05:14 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-04-03 21:05:14 +0000 |
commit | f1412ca58a77159d46432eae4eb56ea9edf432b4 (patch) | |
tree | 6af7d5c4118c4c4b7db6fce6a67c9a5054967ba7 /libgfortran/intrinsics | |
parent | ff2ea58742c65bfe2e779b6e8085a9b387724597 (diff) | |
download | gcc-f1412ca58a77159d46432eae4eb56ea9edf432b4.zip gcc-f1412ca58a77159d46432eae4eb56ea9edf432b4.tar.gz gcc-f1412ca58a77159d46432eae4eb56ea9edf432b4.tar.bz2 |
re PR fortran/31304 (REPEAT argument NCOPIES is not converted as it should)
PR fortran/31304
* fortran/gfortran.h (gfc_charlen_int_kind): New prototype.
* fortran/trans-types.c (gfc_charlen_int_kind): New variable.
(gfc_init_types): Define gfc_charlen_int_kind.
* fortran/trans.h (gfor_fndecl_string_repeat): Remove prototype.
* fortran/trans-decl.c (gfor_fndecl_string_repeat): Delete.
(gfc_build_intrinsic_function_decls): Don't set
gfor_fndecl_string_repeat.
* fortran/trans-intrinsic.c (gfc_conv_intrinsic_repeat): Rewrite
so that we don't have to call a library function.
* fortran/simplify.c (gfc_simplify_repeat): Perform the necessary
checks on the NCOPIES argument, and work with arbitrary size
arguments.
* intrinsics/string_intrinsics.c (string_repeat): Remove.
* gfortran.dg/repeat_2.f90: New test.
* gfortran.dg/repeat_3.f90: New test.
* gfortran.dg/repeat_4.f90: New test.
From-SVN: r123481
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r-- | libgfortran/intrinsics/string_intrinsics.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c index 86ef9d4..1a4b159 100644 --- a/libgfortran/intrinsics/string_intrinsics.c +++ b/libgfortran/intrinsics/string_intrinsics.c @@ -73,9 +73,6 @@ export_proto(string_verify); extern void string_trim (GFC_INTEGER_4 *, void **, GFC_INTEGER_4, const char *); export_proto(string_trim); -extern void string_repeat (char *, GFC_INTEGER_4, const char *, GFC_INTEGER_4); -export_proto(string_repeat); - /* Strings of unequal length are extended with pad characters. */ GFC_INTEGER_4 @@ -352,20 +349,3 @@ string_verify (GFC_INTEGER_4 slen, const char * str, GFC_INTEGER_4 setlen, return 0; } - - -/* Concatenate several copies of a string. */ - -void -string_repeat (char * dest, GFC_INTEGER_4 slen, - const char * src, GFC_INTEGER_4 ncopies) -{ - int i; - - /* We don't need to check that ncopies is non-negative here, because - the front-end already generates code for that check. */ - for (i = 0; i < ncopies; i++) - { - memmove (dest + (i * slen), src, slen); - } -} |