PR 83740 Wrong string length type in bounds check
authorJanne Blomqvist <jb@gcc.gnu.org>
Wed, 10 Jan 2018 11:34:45 +0000 (13:34 +0200)
committerJanne Blomqvist <jb@gcc.gnu.org>
Wed, 10 Jan 2018 11:34:45 +0000 (13:34 +0200)
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

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c

index 8ee13b1930f9e6ae76ffd366c3f2e1bc428b0a39..05ea28ec69ffa64055ee6c96182a134071f89e4f 100644 (file)
@@ -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.
 
index 8a0afe9101cc6ef5278c5f59af6c53a431527150..e35e0c9195fe9b60df09bedaf8a2a4bbc2c8d052 100644 (file)
@@ -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",