From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17486 invoked by alias); 13 Feb 2012 09:39:21 -0000 Received: (qmail 17477 invoked by uid 22791); 13 Feb 2012 09:39:21 -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; Mon, 13 Feb 2012 09:39:06 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52227] New: TARGET attribute mishandled in polymorphic types Date: Mon, 13 Feb 2012 09:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: missed-optimization, rejects-valid, 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 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: 2012-02/txt/msg01249.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52227 Bug #: 52227 Summary: TARGET attribute mishandled in polymorphic types Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: missed-optimization, rejects-valid, wrong-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org CC: pault@gcc.gnu.org Seemingly, the TARGET attribute is mishandled. The following program gives: target :: a,b 1 Error: Duplicate TARGET attribute specified at (1) Thus, there is a rejects valid issue. However, depending which variable is declared first, there is also a potential wrong-code issue as a TARGET variable might still get the "restrict" qualifier in the gimple representation. Or a nontarget might get no "restricted", which is a missed optimization. The other attributes have to be checked as well. That includes VOLATILE and ASYNCHRONOUS. It might be enough that the variable has the proper attribute and that such the attribute is properly propagated; at least volatile seems to be handled correctly, but it should be re-checked. (Asynchronous is currently not used on gimple level, cf. PR49733/PR25829; nevertheless, it should be propagated correctly.) I think the other attributes are either related to dimension/allocatable/pointer and already taken care of - or are dummy-related attributes such as optional, value (cf. PR51284), intent etc. type t end type t class(t), allocatable :: a(:), b(:) target :: a,b select type (a) type is (t) select type (b) type is (t) a(1) = b(1) end select end select end