diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2018-01-10 13:34:45 +0200 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2018-01-10 13:34:45 +0200 |
commit | e10e60cb6e6837eb0335fa1affa8aef71b21ecbf (patch) | |
tree | 997c5af5ede5722501845830f4dba7bce7b5dbe7 /gcc | |
parent | 85c2c761f44b23df217e20354bf83bbe5a4632dd (diff) | |
download | gcc-e10e60cb6e6837eb0335fa1affa8aef71b21ecbf.zip gcc-e10e60cb6e6837eb0335fa1affa8aef71b21ecbf.tar.gz gcc-e10e60cb6e6837eb0335fa1affa8aef71b21ecbf.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8ee13b1..05ea28e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,6 +1,11 @@ 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 LHS type when assigning. diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 8a0afe9..e35e0c9 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -1563,18 +1563,18 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc, { gfc_add_modify (&se->pre, first_len_val, fold_convert (TREE_TYPE (first_len_val), - se->string_length)); + se->string_length)); first_len = false; } else { /* Verify that all constructor elements are of the same length. */ + tree rhs = fold_convert (TREE_TYPE (first_len_val), + se->string_length); tree cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node, first_len_val, - fold_convert (TREE_TYPE - (first_len_val), - se->string_length)); + rhs); gfc_trans_runtime_check (true, false, cond, &se->pre, &expr->where, "Different CHARACTER lengths (%ld/%ld) in array constructor", |