From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14625 invoked by alias); 25 Jan 2012 22:30:51 -0000 Received: (qmail 14611 invoked by uid 22791); 25 Jan 2012 22:30:51 -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; Wed, 25 Jan 2012 22:30:38 +0000 From: "burnus 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: Wed, 25 Jan 2012 23:27: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: burnus 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: CC 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/msg02989.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50981 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #27 from Tobias Burnus 2012-01-25 22:29:53 UTC --- (In reply to comment #22) > Created attachment 26386 [details] > Updated patch +gfc_array_spec * +symbol_as (gfc_symbol *sym) +{ + if (sym->ts.type == BT_CLASS) + return CLASS_DATA (sym)->as; I think the function rather belongs to symbol.c than to resolve.c, unless it is "static". But the real issue is the "if" condition. It should be: if (sym->ts.type == BT_CLASS && sym->attr.class_ok) otherwise, one might get a segfault with gfortran.dg/coarray_poly_1.f90