From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24922 invoked by alias); 20 Feb 2011 20:50:10 -0000 Received: (qmail 24914 invoked by uid 22791); 20 Feb 2011 20:50:09 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,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; Sun, 20 Feb 2011 20:50:05 +0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/46244] gfc_compare_derived_types is buggy X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: ice-on-valid-code, patch 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: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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 Date: Sun, 20 Feb 2011 21:07: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: 2011-02/txt/msg02377.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46244 --- Comment #13 from Dominique d'Humieres 2011-02-20 20:49:44 UTC --- I have applied the patch in comment #12 on top of revision 170344. > Patch, no regression modulo an error message change in null_1.f90 The error is changed from Error: Different types in pointer assignment at (1); attempted assignment of REAL(8) to REAL(4) to Error: Different kind type parameters in pointer assignment at (1) Although I prefer the first form, if it is proven that it is too much work to recover it, the second one requires only to adjust the tests. More annoying the patch breaks the 'move_alloc()' calls, e.g., pr42274 comment #1 or pr42769 comment #1 (apparently this new feature is not tested in the test suite). While looking at the code I have noticed something odd at lines 408 of gcc/fortran/interface.c (patched file): if (derived1 != NULL && derived2 != NULL && strcmp (derived1->name, derived2->name) == 0 && derived1->module != NULL && derived2->module != NULL && strcmp (derived1->module, derived2->module) == 0) return 1; /* Compare type via the rules of the standard. Both types must have the SEQUENCE attribute to be equal. */ if (strcmp (derived1->name, derived2->name)) return 0; If the test 'derived1 != NULL && derived2 != NULL' is really required (i.e., derived1 or derived2 can be NULL when entering the proc), is not it also required later in the code (e.g., strcmp (derived1->name, derived2->name))?