summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-08-11 21:31:35 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-08-11 21:31:35 +0000
commitc9ff1de3ae81dc074cac1fcf12292d38f1224b33 (patch)
treef0f8bee8983ea715a8607999cc83e01bdcf62541 /libgfortran
parent4862826d55a2cdc42cfa3093b90349fc234dee6c (diff)
downloadgcc-c9ff1de3ae81dc074cac1fcf12292d38f1224b33.tar.gz
re PR fortran/32937 (segfault with string and -fdefault-integer-8)
PR fortran/32937 * trans-array.c (gfc_conv_expr_descriptor): Use gfc_conv_const_charlen to generate backend_decl of right type. * trans-expr.c (gfc_conv_expr_op): Use correct return type. (gfc_build_compare_string): Use int type instead of default integer kind for single character comparison. (gfc_conv_aliased_arg): Give backend_decl the right type. * trans-decl.c (gfc_build_intrinsic_function_decls): Make compare_string return an int. * gfortran.dg/char_length_6.f90: New test. * intrinsics/string_intrinsics.c (compare_string): Return an int. * libgfortran.h (compare_string): Likewise. From-SVN: r127363
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/intrinsics/string_intrinsics.c2
-rw-r--r--libgfortran/libgfortran.h4
3 files changed, 8 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 46f7282a639..4e47f28575e 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * intrinsics/string_intrinsics.c (compare_string): Return an int.
+ * libgfortran.h (compare_string): Likewise.
+
2007-08-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/31270
diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c
index 3e0940f59ee..be028114476 100644
--- a/libgfortran/intrinsics/string_intrinsics.c
+++ b/libgfortran/intrinsics/string_intrinsics.c
@@ -79,7 +79,7 @@ export_proto(string_minmax);
/* Strings of unequal length are extended with pad characters. */
-GFC_INTEGER_4
+int
compare_string (GFC_INTEGER_4 len1, const char * s1,
GFC_INTEGER_4 len2, const char * s2)
{
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index c32b5a37e06..6013ce68618 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -759,8 +759,8 @@ internal_proto(internal_unpack_c16);
/* string_intrinsics.c */
-extern GFC_INTEGER_4 compare_string (GFC_INTEGER_4, const char *,
- GFC_INTEGER_4, const char *);
+extern int compare_string (GFC_INTEGER_4, const char *,
+ GFC_INTEGER_4, const char *);
iexport_proto(compare_string);
/* random.c */