Commit e10e60cb by Janne Blomqvist

PR 83740 Wrong string length type in bounds check

This patch fixes up the formatting and corrects the PR number in the
ChangeLog for r256425.

gcc/fortran/ChangeLog:

2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/83740
	* trans-array.c (gfc_trans_array_ctor_element): Fix formatting.

From-SVN: r256426
parent 85c2c761
2018-01-10 Janne Blomqvist <jb@gcc.gnu.org> 2018-01-10 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/84740 PR fortran/83740
* trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
2018-01-10 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/83740
* trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
LHS type when assigning. LHS type when assigning.
......
...@@ -1563,18 +1563,18 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc, ...@@ -1563,18 +1563,18 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc,
{ {
gfc_add_modify (&se->pre, first_len_val, gfc_add_modify (&se->pre, first_len_val,
fold_convert (TREE_TYPE (first_len_val), fold_convert (TREE_TYPE (first_len_val),
se->string_length)); se->string_length));
first_len = false; first_len = false;
} }
else else
{ {
/* Verify that all constructor elements are of the same /* Verify that all constructor elements are of the same
length. */ length. */
tree rhs = fold_convert (TREE_TYPE (first_len_val),
se->string_length);
tree cond = fold_build2_loc (input_location, NE_EXPR, tree cond = fold_build2_loc (input_location, NE_EXPR,
logical_type_node, first_len_val, logical_type_node, first_len_val,
fold_convert (TREE_TYPE rhs);
(first_len_val),
se->string_length));
gfc_trans_runtime_check gfc_trans_runtime_check
(true, false, cond, &se->pre, &expr->where, (true, false, cond, &se->pre, &expr->where,
"Different CHARACTER lengths (%ld/%ld) in array constructor", "Different CHARACTER lengths (%ld/%ld) in array constructor",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment