summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-13 06:02:37 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-13 06:02:37 +0000
commit70cee986fe474d383d193240f10d25b713d0a3db (patch)
treeba706fcfeadf5675a2ed90ca25ae544aaff540f6 /gcc/fortran
parent7ecc2865e7e4d998d38590e1a383eead1d0bcda4 (diff)
downloadgcc-70cee986fe474d383d193240f10d25b713d0a3db.tar.gz
2008-10-13 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r141082 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@141084 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog23
-rw-r--r--gcc/fortran/dependency.c8
-rw-r--r--gcc/fortran/expr.c27
-rw-r--r--gcc/fortran/module.c7
-rw-r--r--gcc/fortran/resolve.c4
5 files changed, 57 insertions, 12 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index a2ca844018c..5bcfb6446ba 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,26 @@
+2008-10-12 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37688
+ * expr.c (gfc_expr_check_typed): Extend permission of untyped
+ expressions to both top-level variable and basic arithmetic expressions.
+
+2008-10-12 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/37787
+ * dependency.c (gfc_are_equivalenced_arrays): Look in symbol
+ namespace rather than current namespace, if it is available.
+
+2008-10-12 Steven G. Kargl <kargls@comcast.net>
+
+ PR fortran/37792
+ * fortran/resolve.c (resolve_fl_variable): Simplify the
+ initializer if there is one.
+
+2008-10-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/37794
+ * module.c (check_for_ambiguous): Remove redundant code.
+
2008-10-09 Daniel Kraft <d@domob.eu>
PR fortran/35723
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index e58c9aaa0e9..05a3dccf1a9 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -547,10 +547,16 @@ gfc_are_equivalenced_arrays (gfc_expr *e1, gfc_expr *e2)
|| !e2->symtree->n.sym->attr.in_equivalence|| !e1->rank || !e2->rank)
return 0;
+ if (e1->symtree->n.sym->ns
+ && e1->symtree->n.sym->ns != gfc_current_ns)
+ l = e1->symtree->n.sym->ns->equiv_lists;
+ else
+ l = gfc_current_ns->equiv_lists;
+
/* Go through the equiv_lists and return 1 if the variables
e1 and e2 are members of the same group and satisfy the
requirement on their relative offsets. */
- for (l = gfc_current_ns->equiv_lists; l; l = l->next)
+ for (; l; l = l->next)
{
fl1 = NULL;
fl2 = NULL;
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 5a167b7067f..73f2c40a36c 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3429,9 +3429,11 @@ gfc_expr_set_symbols_referenced (gfc_expr *expr)
/* Walk an expression tree and check each variable encountered for being typed.
If strict is not set, a top-level variable is tolerated untyped in -std=gnu
- mode; this is for things in legacy-code like:
+ mode as is a basic arithmetic expression using those; this is for things in
+ legacy-code like:
INTEGER :: arr(n), n
+ INTEGER :: arr(n + 1), n
The namespace is needed for IMPLICIT typing. */
@@ -3458,9 +3460,26 @@ gfc_expr_check_typed (gfc_expr* e, gfc_namespace* ns, bool strict)
{
bool error_found;
- /* If this is a top-level variable, do the check with strict given to us. */
- if (!strict && e->expr_type == EXPR_VARIABLE && !e->ref)
- return gfc_check_symbol_typed (e->symtree->n.sym, ns, strict, e->where);
+ /* If this is a top-level variable or EXPR_OP, do the check with strict given
+ to us. */
+ if (!strict)
+ {
+ if (e->expr_type == EXPR_VARIABLE && !e->ref)
+ return gfc_check_symbol_typed (e->symtree->n.sym, ns, strict, e->where);
+
+ if (e->expr_type == EXPR_OP)
+ {
+ gfc_try t = SUCCESS;
+
+ gcc_assert (e->value.op.op1);
+ t = gfc_expr_check_typed (e->value.op.op1, ns, strict);
+
+ if (t == SUCCESS && e->value.op.op2)
+ t = gfc_expr_check_typed (e->value.op.op2, ns, strict);
+
+ return t;
+ }
+ }
/* Otherwise, walk the expression and do it strictly. */
check_typed_ns = ns;
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 3846d953e6b..b9c99fe8f35 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3960,13 +3960,6 @@ check_for_ambiguous (gfc_symbol *st_sym, pointer_info *info)
if (st_sym == rsym)
return false;
- /* Identical derived types are not ambiguous and will be rolled up
- later. */
- if (st_sym->attr.flavor == FL_DERIVED
- && rsym->attr.flavor == FL_DERIVED
- && gfc_compare_derived_types (st_sym, rsym))
- return false;
-
/* If the existing symbol is generic from a different module and
the new symbol is generic there can be no ambiguity. */
if (st_sym->attr.generic
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 6976e64e0c8..70d3ad5df99 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -7525,6 +7525,10 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
}
}
+ /* Ensure that any initializer is simplified. */
+ if (sym->value)
+ gfc_simplify_expr (sym->value, 1);
+
/* Reject illegal initializers. */
if (!sym->mark && sym->value)
{