From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13851 invoked by alias); 10 Jan 2012 17:31:04 -0000 Received: (qmail 13839 invoked by uid 22791); 10 Jan 2012 17:31:03 -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; Tue, 10 Jan 2012 17:30:50 +0000 From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/50981] [4.4/4.5/4.6 Regression] Wrong-code for scalarizing ELEMENTAL call with absent OPTIONAL argument Date: Tue, 10 Jan 2012 17:31: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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: mikael at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.4.7 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 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/msg01074.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50981 --- Comment #16 from Mikael Morin 2012-01-10 17:30:20 UTC --- Created attachment 26296 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26296 Patch for the scalar cases, including the OOP ones (with CLASS). This patch passes gfortran.dg/*elemental*, but fails on gfortran.dg/class_array_{1,2,3,7,9}.f03. I'm inclined to defer the handling of class cases to 4.8. Regarding the patch itself: - there were some cases where code->expr1 didn't have the function reference, and one had to look at code->resolved_sym to have the procedure's (or its interface's) symbol. - the big condition in comment #12 has been trimmed, assuming that: * dummy arguments of elemental procedures don't have the pointer/allocatable attribute * gfc_expr_attr does the right thing w.r.t. class expressions * gfc_expr_attr does not propagate the pointer/allocatable/optional attribute to subcomponents.