aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/fortran/trans-stmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/fortran/trans-stmt.c')
-rw-r--r--gcc-4.9/gcc/fortran/trans-stmt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc-4.9/gcc/fortran/trans-stmt.c b/gcc-4.9/gcc/fortran/trans-stmt.c
index 00c99fcfb..6d2db5ef7 100644
--- a/gcc-4.9/gcc/fortran/trans-stmt.c
+++ b/gcc-4.9/gcc/fortran/trans-stmt.c
@@ -1164,13 +1164,16 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
{
gfc_se se;
tree desc;
+ bool cst_array_ctor;
desc = sym->backend_decl;
+ cst_array_ctor = e->expr_type == EXPR_ARRAY
+ && gfc_constant_array_constructor_p (e->value.constructor);
/* If association is to an expression, evaluate it and create temporary.
Otherwise, get descriptor of target for pointer assignment. */
gfc_init_se (&se, NULL);
- if (sym->assoc->variable || e->expr_type == EXPR_ARRAY)
+ if (sym->assoc->variable || cst_array_ctor)
{
se.direct_byref = 1;
se.use_offset = 1;
@@ -1181,7 +1184,7 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
/* If we didn't already do the pointer assignment, set associate-name
descriptor to the one generated for the temporary. */
- if (!sym->assoc->variable && e->expr_type != EXPR_ARRAY)
+ if (!sym->assoc->variable && !cst_array_ctor)
{
int dim;