aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorAndre Vieira <andre.simoesdiasvieira@arm.com>2018-06-22 14:59:21 +0000
committerAndre Vieira <andre.simoesdiasvieira@arm.com>2018-06-22 14:59:21 +0000
commit80bb895d235d82f30bb097050acc82470b53cf52 (patch)
treed887d893f39d16e4990a853d3398dfc48433430f /gcc/fortran/expr.c
parent701c5838e5f5999de48c3b2c9f2e10b453a78f88 (diff)
parent8483773478af7ea732b52a98e325a07608777ebe (diff)
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch@261903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index f302ef70b86..0d553c0bea2 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2315,7 +2315,7 @@ check_inquiry (gfc_expr *e, int not_restricted)
/* Assumed character length will not reduce to a constant expression
with LEN, as required by the standard. */
- if (i == 5 && not_restricted
+ if (i == 5 && not_restricted && ap->expr->symtree
&& ap->expr->symtree->n.sym->ts.type == BT_CHARACTER
&& (ap->expr->symtree->n.sym->ts.u.cl->length == NULL
|| ap->expr->symtree->n.sym->ts.deferred))
@@ -3288,6 +3288,8 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform,
/* Only DATA Statements come here. */
if (!conform)
{
+ locus *where;
+
/* Numeric can be converted to any other numeric. And Hollerith can be
converted to any other type. */
if ((gfc_numeric_ts (&lvalue->ts) && gfc_numeric_ts (&rvalue->ts))
@@ -3297,8 +3299,9 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform,
if (lvalue->ts.type == BT_LOGICAL && rvalue->ts.type == BT_LOGICAL)
return true;
+ where = lvalue->where.lb ? &lvalue->where : &rvalue->where;
gfc_error ("Incompatible types in DATA statement at %L; attempted "
- "conversion of %s to %s", &lvalue->where,
+ "conversion of %s to %s", where,
gfc_typename (&rvalue->ts), gfc_typename (&lvalue->ts));
return false;