aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2012-03-04 20:46:55 +0000
committerMikael Morin <mikael@gcc.gnu.org>2012-03-04 20:46:55 +0000
commit9bcf7121b65665d72790132ff071e07a1a634151 (patch)
tree9cce6361575bbd4622cd4602cd357413f033a401 /gcc/fortran/trans-array.c
parent904eea2c55c331ba5a836adb5e859ebce9ac9d53 (diff)
downloadgcc-9bcf7121b65665d72790132ff071e07a1a634151.zip
gcc-9bcf7121b65665d72790132ff071e07a1a634151.tar.gz
gcc-9bcf7121b65665d72790132ff071e07a1a634151.tar.bz2
trans.h (struct gfc_ss_info): Move can_be_null_ref component from the data::scalar subcomponent to the toplevel.
fortran/ * trans.h (struct gfc_ss_info): Move can_be_null_ref component from the data::scalar subcomponent to the toplevel. * trans-expr.c (gfc_conv_expr): Update component reference. * trans-array.c (gfc_add_loop_ss_code): Ditto. (gfc_walk_elemental_function_args): Ditto. Move the conditional setting the field out of the scalar-only block. From-SVN: r184893
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index bbe5afe..b54c95b 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2448,7 +2448,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
case GFC_SS_REFERENCE:
/* Scalar argument to elemental procedure. */
gfc_init_se (&se, NULL);
- if (ss_info->data.scalar.can_be_null_ref)
+ if (ss_info->can_be_null_ref)
{
/* If the actual argument can be absent (in other words, it can
be a NULL reference), don't try to evaluate it; pass instead
@@ -8493,17 +8493,18 @@ gfc_walk_elemental_function_args (gfc_ss * ss, gfc_actual_arglist *arg,
newss = gfc_get_scalar_ss (head, arg->expr);
newss->info->type = type;
- if (dummy_arg != NULL
- && dummy_arg->sym->attr.optional
- && arg->expr->expr_type == EXPR_VARIABLE
- && (gfc_expr_attr (arg->expr).optional
- || gfc_expr_attr (arg->expr).allocatable
- || gfc_expr_attr (arg->expr).pointer))
- newss->info->data.scalar.can_be_null_ref = true;
}
else
scalar = 0;
+ if (dummy_arg != NULL
+ && dummy_arg->sym->attr.optional
+ && arg->expr->expr_type == EXPR_VARIABLE
+ && (gfc_expr_attr (arg->expr).optional
+ || gfc_expr_attr (arg->expr).allocatable
+ || gfc_expr_attr (arg->expr).pointer))
+ newss->info->can_be_null_ref = true;
+
head = newss;
if (!tail)
{