From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28818 invoked by alias); 15 Jun 2009 07:46:26 -0000 Received: (qmail 28774 invoked by uid 48); 15 Jun 2009 07:46:13 -0000 Date: Mon, 15 Jun 2009 07:46:00 -0000 Message-ID: <20090615074613.28773.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/40443] Elemental procedure in genericl interface incorrectly selected in preference to specific procedure In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" 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: 2009-06/txt/msg00912.txt.bz2 ------- Comment #1 from burnus at gcc dot gnu dot org 2009-06-15 07:46 ------- Paul, I CC you as you are our generic-resolution expert. * * * gfortran 4.1 to 4.5, NAG f95 5.1, g95, ifort 11, openf95, Sun Studio 12 all print the following: E S, S E E, E ! << you expect an "S, S" here Looking at the following excerpt from Fortran 2003, it looks indeed as if all the compiler get it wrong. Especially, the standard does not assume (to my reading) that the generic resolution depends on the order. However, before changing it, one needs to double check - that several compiler gets it wrong and (of my collection) none gets it correct also happens only rarely. * * * "12.4.4.1 Resolving procedure references to names established to be generic "(1) If the reference is consistent with a nonelemental reference to one of the specific interfaces of a generic interface that has that name and either is in the scoping unit in which the reference appears or is made accessible by a USE statement in the scoping unit, the reference is to the specific procedure in the interface block that provides that interface. The rules in 16.2.3 ensure that there can be at most one such specific procedure. (2) If (1) does not apply, if the reference is consistent with an elemental reference to one of the specific interfaces of a generic interface that has that name and either is in the scoping unit in which the reference appears or is made accessible by a USE statement in the scoping unit, the reference is to the specific elemental procedure in the interface block that provides that interface. The rules in 16.2.3 ensure that there can be at most one such specific elemental procedure." -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault at gcc dot gnu dot | |org, burnus at gcc dot gnu | |dot org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 GCC build triplet|i586-pc-mingw32 | GCC host triplet|i586-pc-mingw32 | GCC target triplet|i586-pc-mingw32 | Keywords| |wrong-code Last reconfirmed|0000-00-00 00:00:00 |2009-06-15 07:46:13 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40443