aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-stmt.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2006-06-03 19:28:33 +0200
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2006-06-03 17:28:33 +0000
commitdd18a33bd9bc113f3c21afc271c7d08f53635644 (patch)
tree2bd078734b2fda2d0a8face0efc809fc5f9589ef /gcc/fortran/trans-stmt.c
parent4f3d90548b4590281766091564da0bb23515af75 (diff)
downloadgcc-dd18a33bd9bc113f3c21afc271c7d08f53635644.zip
gcc-dd18a33bd9bc113f3c21afc271c7d08f53635644.tar.gz
gcc-dd18a33bd9bc113f3c21afc271c7d08f53635644.tar.bz2
trans.c (gfc_msg_bounds, [...]): Add strings for common runtime error messages.
* trans.c (gfc_msg_bounds, gfc_msg_fault, gfc_msg_wrong_return): Add strings for common runtime error messages. (gfc_trans_runtime_check): Add a locus argument, use a string and not a string tree for the message. * trans.h (gfc_trans_runtime_check): Change prototype accordingly. (gfc_msg_bounds, gfc_msg_fault, gfc_msg_wrong_return): Add proto. * trans-const.c (gfc_strconst_bounds, gfc_strconst_fault, gfc_strconst_wrong_return, gfc_strconst_current_filename): Remove. (gfc_init_constants): Likewise. * trans-const.h: Likewise. * trans-decl.c (gfc_build_builtin_function_decls): Call to _gfortran_runtime_error has only one argument, the message string. * trans-array.h (gfc_conv_array_ref): Add a symbol argument and a locus. * trans-array.c (gfc_trans_array_bound_check): Build precise error messages. (gfc_conv_array_ref): Use the new symbol argument and the locus to build more precise error messages. (gfc_conv_ss_startstride): More precise error messages. * trans-expr.c (gfc_conv_variable): Give symbol reference and locus to gfc_conv_array_ref. (gfc_conv_function_call): Use the new prototype for gfc_trans_runtime_check. * trans-stmt.c (gfc_trans_goto): Build more precise error message. * trans-io.c (set_string): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use new prototype for gfc_trans_runtime_check. From-SVN: r114346
Diffstat (limited to 'gcc/fortran/trans-stmt.c')
-rw-r--r--gcc/fortran/trans-stmt.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 562e6f1..ef7d680 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -31,6 +31,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "toplev.h"
#include "real.h"
#include "gfortran.h"
+#include "flags.h"
#include "trans.h"
#include "trans-stmt.h"
#include "trans-types.h"
@@ -139,14 +140,12 @@ gfc_trans_label_assign (gfc_code * code)
tree
gfc_trans_goto (gfc_code * code)
{
+ locus loc = code->loc;
tree assigned_goto;
tree target;
tree tmp;
- tree assign_error;
- tree range_error;
gfc_se se;
-
if (code->label != NULL)
return build1_v (GOTO_EXPR, gfc_get_label_decl (code->label));
@@ -154,12 +153,11 @@ gfc_trans_goto (gfc_code * code)
gfc_init_se (&se, NULL);
gfc_start_block (&se.pre);
gfc_conv_label_variable (&se, code->expr);
- assign_error =
- gfc_build_cstring_const ("Assigned label is not a target label");
tmp = GFC_DECL_STRING_LEN (se.expr);
tmp = fold_build2 (NE_EXPR, boolean_type_node, tmp,
build_int_cst (TREE_TYPE (tmp), -1));
- gfc_trans_runtime_check (tmp, assign_error, &se.pre);
+ gfc_trans_runtime_check (tmp, "Assigned label is not a target label",
+ &se.pre, &loc);
assigned_goto = GFC_DECL_ASSIGN_ADDR (se.expr);
@@ -172,8 +170,6 @@ gfc_trans_goto (gfc_code * code)
}
/* Check the label list. */
- range_error = gfc_build_cstring_const ("Assigned label is not in the list");
-
do
{
target = gfc_get_label_decl (code->label);
@@ -186,7 +182,9 @@ gfc_trans_goto (gfc_code * code)
code = code->block;
}
while (code != NULL);
- gfc_trans_runtime_check (boolean_true_node, range_error, &se.pre);
+ gfc_trans_runtime_check (boolean_true_node,
+ "Assigned label is not in the list", &se.pre, &loc);
+
return gfc_finish_block (&se.pre);
}