aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobi@gcc.gnu.org>2004-06-12 16:06:19 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2004-06-12 16:06:19 +0200
commit662ef0f5c62f781c4d20406ee11333c63bac8eef (patch)
tree3f6f1f97c22b8ddc8b4db0231e42b95da118a586 /gcc/fortran/trans-expr.c
parent4aef80f8e0b9f3a18e2afb6d10dcdcc26683d34d (diff)
downloadgcc-662ef0f5c62f781c4d20406ee11333c63bac8eef.zip
gcc-662ef0f5c62f781c4d20406ee11333c63bac8eef.tar.gz
gcc-662ef0f5c62f781c4d20406ee11333c63bac8eef.tar.bz2
re PR fortran/12841 (passing null to a subroutine)
fortran/ PR fortran/12841 * interface.c (compare_parameter, compare_actual_formal): Don't check types and array shapes for NULL() * trans-expr.c (conv_function_call): No double indirection for NULL() ( I had accidentally committed the interface.c part before) testuite/ PR fortran/12841 * gfortran.fortran-torture/execute/null_arg.f90: New test. From-SVN: r83028
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 2258ce6..e4953f6 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1100,10 +1100,12 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
if (argss == gfc_ss_terminator)
{
gfc_conv_expr_reference (&parmse, arg->expr);
- if (formal && formal->sym->attr.pointer)
+ if (formal && formal->sym->attr.pointer
+ && arg->expr->expr_type != EXPR_NULL)
{
/* Scalar pointer dummy args require an extra level of
- indirection. */
+ indirection. The null pointer already contains
+ this level of indirection. */
parmse.expr = gfc_build_addr_expr (NULL, parmse.expr);
}
}