This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47469] New: Check whether arrayfunc_assign_needs_temporary misses TBP/PPC attributes
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Jan 2011 09:50:23 +0000
- Subject: [Bug fortran/47469] New: Check whether arrayfunc_assign_needs_temporary misses TBP/PPC attributes
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47469
Summary: Check whether arrayfunc_assign_needs_temporary misses
TBP/PPC attributes
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
CC: pault@gcc.gnu.org, janus@gcc.gnu.org
Found when looking at PR 47455 and trans-expr.c:
I wonder whether for type-bound procedures or for procedure-pointer components,
the "pointer" or "allocatable" attribute is properly taken into account in
arrayfunc_assign_needs_temporary.
However, I have not checked whether this is an really and issue or whether
there are other related issues.
Thus, something like:
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -5346,8 +5381,8 @@ arrayfunc_assign_needs_temporary (gfc_expr * expr1,
gfc_expr * expr2)
return true;
/* Functions returning pointers need temporaries. */
- if (expr2->symtree->n.sym->attr.pointer
- || expr2->symtree->n.sym->attr.allocatable)
+ if (gfc_expr_attr (expr2).pointer
+ || gfc_expr_attr (expr2).allocatable)
return true;
/* Character array functions need temporaries unless the