From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32605 invoked by alias); 7 Jan 2012 23:31:32 -0000 Received: (qmail 32596 invoked by uid 22791); 7 Jan 2012 23:31:30 -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; Sat, 07 Jan 2012 23:31:17 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51790] New: Broken ambiguity check when combining generic with nongeneric procedures Date: Sat, 07 Jan 2012 23:31: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: accepts-invalid, diagnostic 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-01/txt/msg00771.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51790 Bug #: 51790 Summary: Broken ambiguity check when combining generic with nongeneric procedures Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: accepts-invalid, diagnostic Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org Blocks: 51578 Another bug which blocks my progress with PR 51578. If one compiles gfortran.dg/generic_11.f90 one gets the error: call foo ! { dg-error "is an ambiguous reference" } 1 Error: Name 'foo' at (1) is an ambiguous reference to 'foo' from module 'm_foo' However, if one swaps the order of use m_foo use m_bar no error is printed. The reason is that in symbol's gfc_find_sym_tree one has the check: if (st->ambiguous && !st->n.sym->attr.generic) { ambiguous_symbol (name, st); However, one of the "foo" is generic and the other isn't. Thus, depending which one is first in the symtree, an error is printed or not.