diff options
author | Tobias Burnus <burnus@net-b.de> | 2007-03-01 09:19:09 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2007-03-01 09:19:09 +0100 |
commit | 9c3e90e34652aeae1dcdd570f2de5968d653c935 (patch) | |
tree | de6315cf47b867d4dfd056f5bae27b24174019a9 /gcc/fortran/trans-intrinsic.c | |
parent | aedcd6959236c7612f81b2ae7907d2053abda81a (diff) | |
download | gcc-9c3e90e34652aeae1dcdd570f2de5968d653c935.zip gcc-9c3e90e34652aeae1dcdd570f2de5968d653c935.tar.gz gcc-9c3e90e34652aeae1dcdd570f2de5968d653c935.tar.bz2 |
re PR fortran/30865 ([4.1, 4.2 only] optional argument passed on to size(...,dim=))
2007-03-01 Tobias Burnus <burnus@net-b.de>
PR fortran/30865
* trans-intrinsic.c (gfc_conv_intrinsic_size): Compare pointers.
From-SVN: r122423
Diffstat (limited to 'gcc/fortran/trans-intrinsic.c')
-rw-r--r-- | gcc/fortran/trans-intrinsic.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 267d7a9..6c08004 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -2723,10 +2723,13 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr) && actual->expr->symtree->n.sym->attr.optional) { tree tmp; - tmp = gfc_build_addr_expr (pvoid_type_node, - argse.expr); - tmp = build2 (NE_EXPR, boolean_type_node, tmp, - build_int_cst (pvoid_type_node, 0)); + gfc_init_se (&argse, NULL); + argse.want_pointer = 1; + argse.data_not_needed = 1; + gfc_conv_expr (&argse, actual->expr); + gfc_add_block_to_block (&se->pre, &argse.pre); + tmp = build2 (NE_EXPR, boolean_type_node, argse.expr, + null_pointer_node); tmp = gfc_evaluate_now (tmp, &se->pre); se->expr = build3 (COND_EXPR, pvoid_type_node, tmp, fncall1, fncall0); |