From patchwork Thu Dec 1 20:40:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Kargl X-Patchwork-Id: 86148 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp874076qgi; Thu, 1 Dec 2016 12:40:45 -0800 (PST) X-Received: by 10.98.159.136 with SMTP id v8mr40742396pfk.82.1480624845636; Thu, 01 Dec 2016 12:40:45 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i70si1513312pge.249.2016.12.01.12.40.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 12:40:45 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443257-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-443257-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443257-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=k23IIgb1TtdIbnj/VS0/zjh5JboCYVVwU2DJrRC2qbW 8k48Chz8D0kp855j1Vy2ekokWlo/gTfEHBAYAwpLSB+sJI4yL7ZinRZdVs4m7kAV JQeXPJDPqmKu6C5Dm/UnHmxANZflIBiSpt7uWCsgpezsHJ/z4o7cKnYmB3ThT5Vs = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=LZItb8u1SDM1bjw+VMySh5sxh2Q=; b=jzab5aOM3+bArzbkq i2YeyrARGw31W4Wnen+JdGUyGpz7X3B4sDpbJPlMFgFZRXLCKCE8CqJDF3iQycQg V33yA9EhBBy3KBW4BUXUGz+emsTKEjplQgutUI13nsm6OaQBky3XF6mJpYTKKAzH WtOjHUa9Y1Ne1aq6gf+GUv1SCk= Received: (qmail 11653 invoked by alias); 1 Dec 2016 20:40:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 11615 invoked by uid 89); 1 Dec 2016 20:40:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=nonexistent, *a1, dg-error, dgerror 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 ESMTP; Thu, 01 Dec 2016 20:40:15 +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 uB1KeDun053164 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 1 Dec 2016 12:40:13 -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 uB1KeDpB053163; Thu, 1 Dec 2016 12:40:13 -0800 (PST) (envelope-from sgk) Date: Thu, 1 Dec 2016 12:40:13 -0800 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [Committed] PR fortran/78279 -- convert gcc_assert to internal error Message-ID: <20161201204013.GA53129@troutmask.apl.washington.edu> Reply-To: kargl@uw.edu MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) I've committed the attached patch, which converts a gcc_assert() to a conditional express tha may call gfc_internal_error().o 2016-12-01 Steven G. Kargl PR fortran/78279 * dependency.c (identical_array_ref): Convert gcc_assert to conditional and gfc_internal_error. 2016-12-01 Steven G. Kargl PR fortran/78279 * gfortran.dg/pr78279.f90: New test. -- Steve Index: gcc/fortran/dependency.c =================================================================== --- gcc/fortran/dependency.c (revision 242789) +++ gcc/fortran/dependency.c (working copy) @@ -101,7 +101,9 @@ identical_array_ref (gfc_array_ref *a1, if (a1->type == AR_ELEMENT && a2->type == AR_ELEMENT) { - gcc_assert (a1->dimen == a2->dimen); + if (a1->dimen != a2->dimen) + gfc_internal_error ("identical_array_ref(): inconsistent dimensions"); + for (i = 0; i < a1->dimen; i++) { if (gfc_dep_compare_expr (a1->start[i], a2->start[i]) != 0) Index: gcc/testsuite/gfortran.dg/pr78279.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pr78279.f90 (nonexistent) +++ gcc/testsuite/gfortran.dg/pr78279.f90 (working copy) @@ -0,0 +1,10 @@ +! { dg-do compile } +! { dg-options "-Ofast" } +program p + integer :: i + real :: z(2,4) + z = 0.0 + do i = 1, 3 + if ( z(i) > z(1,i+1) ) print *, i ! { dg-error "mismatch in array reference" } + end do +end