summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-intrinsic.c
diff options
context:
space:
mode:
authordomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-18 10:05:54 +0000
committerdomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-18 10:05:54 +0000
commit9c5786bd5e85945c2b68fac9b447e4db0103fe0d (patch)
treec4d520f172c9b4f97852d08d4e5fc12e76b2adde /gcc/fortran/trans-intrinsic.c
parent9ce936943bfdc66c5adb5524b0910ace271c606a (diff)
downloadgcc-9c5786bd5e85945c2b68fac9b447e4db0103fe0d.tar.gz
2008-12-18 Daniel Kraft <d@domob.eu>
PR fortran/31822 * gfortran.h (gfc_check_same_strlen): Made public. * trans.h (gfc_trans_same_strlen_check): Made public. * check.c (gfc_check_same_strlen): Made public and adapted error message output to be useful not only for intrinsics. (gfc_check_merge): Adapt to gfc_check_same_strlen change. * expr.c (gfc_check_pointer_assign): Use gfc_check_same_strlen for string length compile-time check. * trans-expr.c (gfc_trans_pointer_assignment): Add runtime-check for equal string lengths using gfc_trans_same_strlen_check. * trans-intrinsic.c (gfc_trans_same_strlen_check): Renamed and made public from conv_same_strlen_check. (gfc_conv_intrinsic_merge): Adapted accordingly. 2008-12-18 Daniel Kraft <d@domob.eu> PR fortran/31822 * gfortran.dg/char_pointer_assign_2.f90: Updated expected error message to be more detailed. * gfortran.dg/char_pointer_assign_4.f90: New test. * gfortran.dg/char_pointer_assign_5.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142808 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-intrinsic.c')
-rw-r--r--gcc/fortran/trans-intrinsic.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 577cd20d17f..e006ea718a8 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -751,9 +751,9 @@ gfc_conv_intrinsic_lib_function (gfc_se * se, gfc_expr * expr)
string lengths for both expressions are the same (needed for e.g. MERGE).
If bounds-checking is not enabled, does nothing. */
-static void
-conv_same_strlen_check (const char* intr_name, locus* where, tree a, tree b,
- stmtblock_t* target)
+void
+gfc_trans_same_strlen_check (const char* intr_name, locus* where,
+ tree a, tree b, stmtblock_t* target)
{
tree cond;
tree name;
@@ -769,8 +769,7 @@ conv_same_strlen_check (const char* intr_name, locus* where, tree a, tree b,
name = gfc_build_cstring_const (intr_name);
name = gfc_build_addr_expr (pchar_type_node, name);
gfc_trans_runtime_check (true, false, cond, target, where,
- "Unequal character lengths (%ld/%ld) for arguments"
- " to %s",
+ "Unequal character lengths (%ld/%ld) in %s",
fold_convert (long_integer_type_node, a),
fold_convert (long_integer_type_node, b), name);
}
@@ -3081,8 +3080,8 @@ gfc_conv_intrinsic_merge (gfc_se * se, gfc_expr * expr)
fsource = args[3];
mask = args[4];
- conv_same_strlen_check ("MERGE", &expr->where, len, len2, &se->post);
-
+ gfc_trans_same_strlen_check ("MERGE intrinsic", &expr->where, len, len2,
+ &se->pre);
se->string_length = len;
}
type = TREE_TYPE (tsource);