aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2011-02-14 12:59:53 +0100
committerJanus Weil <janus@gcc.gnu.org>2011-02-14 12:59:53 +0100
commit93302a249147f4260a9f3ab1c7f9a30a268b42c1 (patch)
tree172e199312149686d90adfedcad99c359adb92f4 /gcc/fortran
parent75eec5b611f82b23445fad973847b5ec8b62fbae (diff)
downloadgcc-93302a249147f4260a9f3ab1c7f9a30a268b42c1.zip
gcc-93302a249147f4260a9f3ab1c7f9a30a268b42c1.tar.gz
gcc-93302a249147f4260a9f3ab1c7f9a30a268b42c1.tar.bz2
re PR fortran/47349 (missing warning: Actual argument contains too few elements)
2011-02-14 Janus Weil <janus@gcc.gnu.org> PR fortran/47349 * interface.c (get_expr_storage_size): Handle derived-type components. 2011-02-14 Janus Weil <janus@gcc.gnu.org> PR fortran/47349 * gfortran.dg/argument_checking_18.f90: New. From-SVN: r170125
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/interface.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 1f63acc..9bf2eb0 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47349
+ * interface.c (get_expr_storage_size): Handle derived-type components.
+
2011-02-13 Tobias Burnus <burnus@net-b.de>
PR fortran/47569
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index a03bbeb..071eed9 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1910,7 +1910,7 @@ get_expr_storage_size (gfc_expr *e)
else if (ref->type == REF_ARRAY && ref->u.ar.type == AR_ELEMENT
&& e->expr_type == EXPR_VARIABLE)
{
- if (e->symtree->n.sym->as->type == AS_ASSUMED_SHAPE
+ if (ref->u.ar.as->type == AS_ASSUMED_SHAPE
|| e->symtree->n.sym->attr.pointer)
{
elements = 1;
@@ -1939,8 +1939,6 @@ get_expr_storage_size (gfc_expr *e)
- mpz_get_si (ref->u.ar.as->lower[i]->value.integer));
}
}
- else
- return 0;
}
if (substrlen)
@@ -2130,9 +2128,9 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
actual_size = get_expr_storage_size (a->expr);
formal_size = get_sym_storage_size (f->sym);
- if (actual_size != 0
- && actual_size < formal_size
- && a->expr->ts.type != BT_PROCEDURE)
+ if (actual_size != 0 && actual_size < formal_size
+ && a->expr->ts.type != BT_PROCEDURE
+ && f->sym->attr.flavor != FL_PROCEDURE)
{
if (a->expr->ts.type == BT_CHARACTER && !f->sym->as && where)
gfc_warning ("Character length of actual argument shorter "