From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22609 invoked by alias); 13 Nov 2012 11:20:38 -0000 Received: (qmail 22251 invoked by uid 48); 13 Nov 2012 11:19:25 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55297] [4.8 Regression] type-bound operator clashes with abstract interface Date: Tue, 13 Nov 2012 11:20:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Keywords CC Target Milestone Message-ID: In-Reply-To: References: 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-11/txt/msg01137.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55297 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid CC| |burnus at gcc dot gnu.org Target Milestone|--- |4.8.0 --- Comment #2 from Tobias Burnus 2012-11-13 11:19:24 UTC --- Seems to be due to http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189022 for PR fortran/41951 and PR fortran/49591. In the resolve.c's resolve_typebound_intrinsic_op: 11546 if (gfc_check_new_interface (derived->ns->op[op], target_proc, 11547 p->where) == FAILURE) Here target_proc->name == "negative" and target_proc->ns->proc_name->name == "athlete_module" The symbol (i.e. derived type) is resolved twice: Once for the "module athlete_module" (= gfc_current_ns->proc_name) and then again for the abstract interface procedure "sum_interface" (= gfc_current_ns->proc_name). In either case, one has derived->ns->proc_name->name == "athlete_module", which causes the symbol be added twice added to the same namespace. The question is whether it should be fixed by adding if (derived->ns != gfc_current_ns) return; Or using "gfc_current_ns" instead of "derived->ns". Or what's the most appropriate fix.