aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorvehre <vehre@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-02 09:59:47 +0000
committervehre <vehre@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-02 09:59:47 +0000
commit9606162b3b68729184979d8f186e93b239246fd9 (patch)
tree1aef4fe064bf03b726363ccaf7b50cccdd9eb5b6 /gcc/fortran
parentdc40b8b585a2f9ba867d1d1ed2601d2e7701495e (diff)
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220345 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/trans-decl.c2
-rw-r--r--gcc/fortran/trans-expr.c40
3 files changed, 27 insertions, 22 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 7e455ef80d8..6d5964af5b6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -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
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 8a65d2bef8f..3664824ce09 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -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;
}
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 70da287dae4..6b11fb3c55b 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);