trans-decl.c (gfc_get_symbol_decl): Removed duplicate code.
authorAndre Vehreschild <vehre@gmx.de>
Mon, 2 Feb 2015 09:59:47 +0000 (10:59 +0100)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Mon, 2 Feb 2015 09:59:47 +0000 (10:59 +0100)
* trans-decl.c (gfc_get_symbol_decl): Removed duplicate code.
* trans-expr.c (gfc_conv_intrinsic_to_class): Fixed indentation.
Fixed datatype of charlen to be a 32-bit int.

From-SVN: r220345

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/fortran/trans-expr.c

index 7e455ef80d8b552f4d360b142e40db8ce61ee580..6d5964af5b60ea0ec03ded5a764e9e2eef0c05fb 100644 (file)
@@ -1,3 +1,10 @@
+
+2015-01-30  Andre Vehreschild  <vehre@gmx.de>
+
+       * trans-decl.c (gfc_get_symbol_decl): Removed duplicate code.
+       * trans-expr.c (gfc_conv_intrinsic_to_class): Fixed indentation.
+       Fixed datatype of charlen to be a 32-bit int.
+
 2015-02-01  Joseph Myers  <joseph@codesourcery.com>
 
        * error.c (gfc_warning (const char *, ...), gfc_warning_now (const
index 8a65d2bef8f5b8b0cebe211a6c513119a1a61bba..3664824ce09169e8949a0c5a571398dc1dc35a5f 100644 (file)
@@ -1443,8 +1443,6 @@ gfc_get_symbol_decl (gfc_symbol * sym)
       if (sym->ts.type == BT_CLASS && sym->backend_decl)
        GFC_DECL_CLASS(sym->backend_decl) = 1;
 
-      if (sym->ts.type == BT_CLASS && sym->backend_decl)
-       GFC_DECL_CLASS(sym->backend_decl) = 1;
      return sym->backend_decl;
     }
 
index 70da287dae47f721a4863815715460a9f798defd..6b11fb3c55b9773a6ec3f123f18a011f0caf207a 100644 (file)
@@ -660,26 +660,26 @@ gfc_conv_intrinsic_to_class (gfc_se *parmse, gfc_expr *e,
         expression can be evaluated to a constant one.  */
       else
         {
-          /* Try to simplify the expression.  */
-          gfc_simplify_expr (e, 0);
-          if (e->expr_type == EXPR_CONSTANT && !e->ts.u.cl->resolved)
-            {
-              /* Amazingly all data is present to compute the length of a
-                 constant string, but the expression is not yet there.  */
-              e->ts.u.cl->length = gfc_get_constant_expr (BT_INTEGER, 1,
-                                                          &e->where);
-              mpz_set_ui (e->ts.u.cl->length->value.integer,
-                          e->value.character.length);
-              gfc_conv_const_charlen (e->ts.u.cl);
-              e->ts.u.cl->resolved = 1;
-              gfc_add_modify (&parmse->pre, ctree, e->ts.u.cl->backend_decl);
-            }
-          else
-            {
-              gfc_error ("Can't compute the length of the char array at %L.",
-                         &e->where);
-            }
-        }
+         /* Try to simplify the expression.  */
+         gfc_simplify_expr (e, 0);
+         if (e->expr_type == EXPR_CONSTANT && !e->ts.u.cl->resolved)
+           {
+             /* Amazingly all data is present to compute the length of a
+                constant string, but the expression is not yet there.  */
+             e->ts.u.cl->length = gfc_get_constant_expr (BT_INTEGER, 4,
+                                                         &e->where);
+             mpz_set_ui (e->ts.u.cl->length->value.integer,
+                         e->value.character.length);
+             gfc_conv_const_charlen (e->ts.u.cl);
+             e->ts.u.cl->resolved = 1;
+             gfc_add_modify (&parmse->pre, ctree, e->ts.u.cl->backend_decl);
+           }
+         else
+           {
+             gfc_error ("Can't compute the length of the char array at %L.",
+                        &e->where);
+           }
+       }
     }
   /* Pass the address of the class object.  */
   parmse->expr = gfc_build_addr_expr (NULL_TREE, var);