From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10425 invoked by alias); 30 Oct 2010 11:52:57 -0000 Received: (qmail 10416 invoked by uid 22791); 30 Oct 2010 11:52:57 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID 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, 30 Oct 2010 11:52:53 +0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/46196] [OOP] gfortran compiles invalid generic TBP: dummy arguments are type compatible X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: janus at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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 Date: Sat, 30 Oct 2010 11:52: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: 2010-10/txt/msg02564.txt.bz2 Message-ID: <20101030115200.ocJIVA19fpdJZRF7nTKu7k3DwwUCtgzGjP2ty6rSxmQ@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46196 --- Comment #10 from Dominique d'Humieres 2010-10-30 11:52:46 UTC --- > Can we find any test case which is sensitive to this change? I di not find one in store!-( Am I correct to expect that such test will be of the "reject valid" kind? Clearly (dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived) && !(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived) is always false and the third test is the same. So these tests are just nops and the 'return 0' will never be reached. Then the if-else block reduces to if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived) && gfc_compare_types (&dt1->ts, &dt2->ts) == 0) return 0; For this case we need a test with 'dt1->ts.type == BT_DERIVED' and 'dt1->ts.u.derived == derived1' and one of these conditions false for dt2. My understanding of the code is not good enough to reach a valid test from that (I don't know where derived* come from.