From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23680 invoked by alias); 26 Jan 2011 09:50:29 -0000 Received: (qmail 23659 invoked by uid 22791); 26 Jan 2011 09:50:28 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Jan 2011 09:50:24 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47469] New: Check whether arrayfunc_assign_needs_temporary misses TBP/PPC attributes X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 26 Jan 2011 09:58:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg02786.txt.bz2 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