diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-03 08:26:08 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-03 08:26:08 +0000 |
commit | 27635231f058eebc201d5fd7cf67ca6b7d8530ee (patch) | |
tree | 73c8a5aef1a09b5453b90f76643270931f047026 /gcc/fortran/interface.c | |
parent | 74fd5bc4b54d024cb36dfa723ef18da42a1c2c9c (diff) | |
download | gcc-27635231f058eebc201d5fd7cf67ca6b7d8530ee.tar.gz |
2010-02-03 Tobias Burnus <burnus@net-b.de>
PR fortran/42936
* interface.c (compare_parameter): Disable rank-checking
for NULL().
2010-02-03 Tobias Burnus <burnus@net-b.de>
PR fortran/42936
* gfortran.dg/null_4.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156461 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index f27d75c333f..7bccaa6fffe 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1449,9 +1449,11 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, rank_check = where != NULL && !is_elemental && formal->as && (formal->as->type == AS_ASSUMED_SHAPE - || formal->as->type == AS_DEFERRED); + || formal->as->type == AS_DEFERRED) + && actual->expr_type != EXPR_NULL; - if (rank_check || ranks_must_agree || formal->attr.pointer + if (rank_check || ranks_must_agree + || (formal->attr.pointer && actual->expr_type != EXPR_NULL) || (actual->rank != 0 && !(is_elemental || formal->attr.dimension)) || (actual->rank == 0 && formal->as->type == AS_ASSUMED_SHAPE)) { @@ -1493,7 +1495,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, else return 1; } - else if (ref == NULL) + else if (ref == NULL && actual->expr_type != EXPR_NULL) { if (where) gfc_error ("Rank mismatch in argument '%s' at %L (%d and %d)", |