From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28376 invoked by alias); 11 Nov 2015 18:34:57 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 28351 invoked by uid 89); 11 Nov 2015 18:34:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 11 Nov 2015 18:34:54 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id tABIYpUE067426 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 11 Nov 2015 10:34:51 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id tABIYoMd067425; Wed, 11 Nov 2015 10:34:50 -0800 (PST) (envelope-from sgk) Date: Wed, 11 Nov 2015 18:34:00 -0000 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] PR fortran/68283 -- remove a rogue gfc_internal_error() Message-ID: <20151111183450.GA67393@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00057.txt.bz2 --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 731 This probably falls under the "obviously correct" moniker. It has been built and tested on i386-*-freebsd. OK to commit? The patch removes a gfc_internal_error(). I suspect that it was originally put into gfortran to cover "correctly written valid Fortran code cannot possibly ever hit this line of code; so, it must be an internal error to reach this line". The code in PR 68283 is not valid Fortran. A number of error messages are spewed by gfortran prior to hitting this line of code. The patch simply removes the gfc_internal_error(), which allows gfortran to exit gracefully. 2015-11-11 Steven G. Kargl PR fortran/68283 * primary.c (gfc_variable_attr): Remove a gfc_internal_error(). -- Steve --IJpNTDwzlM2Ie8A6 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pr68283.diff" Content-length: 414 Index: gcc/fortran/primary.c =================================================================== --- gcc/fortran/primary.c (revision 229970) +++ gcc/fortran/primary.c (working copy) @@ -2268,8 +2268,6 @@ gfc_variable_attr (gfc_expr *expr, gfc_t && errors > 0) break; } - if (n == ref->u.ar.as->rank) - gfc_internal_error ("gfc_variable_attr(): Bad array reference"); } break; --IJpNTDwzlM2Ie8A6--