summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2006-07-12 17:11:11 +0200
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2006-07-12 15:11:11 +0000
commitb3eb1e0e9c1dc7cf7bf0a0d919a1a6239e37298b (patch)
tree72011c46efd76d2283de727ac46c303a3a63e36b /libgfortran
parent45e49d96406fc14662840eaf7d82b2bcbbbccab2 (diff)
downloadgcc-b3eb1e0e9c1dc7cf7bf0a0d919a1a6239e37298b.tar.gz
re PR fortran/28163 (Calling libgfortran's copy_string is inefficient)
PR fortran/28163 * trans-expr.c (gfc_trans_string_copy): Generate inline code to perform string copying instead of calling a library function. * trans-decl.c (gfc_build_intrinsic_function_decls): Don't build decl for copy_string. * trans.h (gfor_fndecl_copy_string): Remove prototype. * intrinsics/string_intrinsics.c (copy_string): Remove function. From-SVN: r115372
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/intrinsics/string_intrinsics.c23
2 files changed, 5 insertions, 23 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index a6801124805..b4478b43e9f 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-12 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR fortran/28163
+ * intrinsics/string_intrinsics.c (copy_string): Remove function.
+
2006-07-04 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* intrinsics/date_and_time.c (itime0,idate0,itime_i4,itime_i8,
diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c
index 1bc4ff22012..fdaddef3327 100644
--- a/libgfortran/intrinsics/string_intrinsics.c
+++ b/libgfortran/intrinsics/string_intrinsics.c
@@ -44,9 +44,6 @@ Boston, MA 02110-1301, USA. */
/* String functions. */
-extern void copy_string (GFC_INTEGER_4, char *, GFC_INTEGER_4, const char *);
-export_proto(copy_string);
-
extern void concat_string (GFC_INTEGER_4, char *,
GFC_INTEGER_4, const char *,
GFC_INTEGER_4, const char *);
@@ -79,26 +76,6 @@ export_proto(string_trim);
extern void string_repeat (char *, GFC_INTEGER_4, const char *, GFC_INTEGER_4);
export_proto(string_repeat);
-/* The two areas may overlap so we use memmove. */
-
-void
-copy_string (GFC_INTEGER_4 destlen, char * dest,
- GFC_INTEGER_4 srclen, const char * src)
-{
- if (srclen >= destlen)
- {
- /* This will truncate if too long. */
- memmove (dest, src, destlen);
- }
- else
- {
- memmove (dest, src, srclen);
- /* Pad with spaces. */
- memset (&dest[srclen], ' ', destlen - srclen);
- }
-}
-
-
/* Strings of unequal length are extended with pad characters. */
GFC_INTEGER_4