aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gmx.de>2015-02-02 10:59:47 +0100
committerAndre Vehreschild <vehre@gcc.gnu.org>2015-02-02 10:59:47 +0100
commit56d1b78a4ac49ff3f526222369001f1d717e483e (patch)
tree1aef4fe064bf03b726363ccaf7b50cccdd9eb5b6 /gcc/fortran/trans-expr.c
parente404a667bf4b0fcef2a4af1b32ef21f5b07367b6 (diff)
downloadgcc-56d1b78a4ac49ff3f526222369001f1d717e483e.zip
gcc-56d1b78a4ac49ff3f526222369001f1d717e483e.tar.gz
gcc-56d1b78a4ac49ff3f526222369001f1d717e483e.tar.bz2
trans-decl.c (gfc_get_symbol_decl): Removed duplicate code.
* 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
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 70da287..6b11fb3 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -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);