aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2020-10-07 14:59:10 +0100
committerPaul Thomas <pault@gcc.gnu.org>2020-10-07 14:59:10 +0100
commit7c7e841806aecf4187c69fc2ff07813c7be09582 (patch)
treea12073cd20d36b50c0d5fad3433ed88e81e415e1 /gcc/fortran/trans-expr.c
parent2f7c50b7091c09d665aaf27173aacf34c9904e4c (diff)
downloadgcc-7c7e841806aecf4187c69fc2ff07813c7be09582.zip
gcc-7c7e841806aecf4187c69fc2ff07813c7be09582.tar.gz
gcc-7c7e841806aecf4187c69fc2ff07813c7be09582.tar.bz2
This patch fixes PR47469 - a trivial bit of tidying up.
2020-07-10 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/47469 * trans-expr.c (arrayfunc_assign_needs_temporary): Tidy detection of pointer and allocatable functions.
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 2c31ec9..2167de4 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -9810,12 +9810,8 @@ arrayfunc_assign_needs_temporary (gfc_expr * expr1, gfc_expr * expr2)
return true;
/* Functions returning pointers or allocatables need temporaries. */
- c = expr2->value.function.esym
- ? (expr2->value.function.esym->attr.pointer
- || expr2->value.function.esym->attr.allocatable)
- : (expr2->symtree->n.sym->attr.pointer
- || expr2->symtree->n.sym->attr.allocatable);
- if (c)
+ if (gfc_expr_attr (expr2).pointer
+ || gfc_expr_attr (expr2).allocatable)
return true;
/* Character array functions need temporaries unless the