From patchwork Fri Mar 17 16:48:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Trippelsdorf X-Patchwork-Id: 740398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vlBB42yhxz9s2Q for ; Sat, 18 Mar 2017 03:48:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="SZNjOSzP"; dkim-atps=neutral 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=JGPnGzXTbGvFMjAe5 WzUR30M6BAVqZ4pO2mR/PAztiYVeGVHxaQqJBXLSrJ8kJBPLQD6ED7gBVd1vTu+b bMsKPDe9Kkzb+3u5j5+Lfc+AFIfimI9hh4h/EFIortI4Vcqx3FYvN6cKrPzhLiMD 4pHb9L2TxATwBgbH5x6FOHzIDA= 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=KEZWaSUXC7EuQ/cBSakWOwR e0N8=; b=SZNjOSzPd7vSnDaMx71tHKgj4m4JQ3Eh9j8SqmyP5IWxaeImTG1001d lrKtuAd3i+siDleRcts82Csc0RPp45/lOdF3B6hN4VgDUGnrp5/wzd4HHrYAzSG1 HdRcUknMTeYkaokLjlGFBpV9hERTYt98UGiuCSfrYWoZ2kEIk49I= Received: (qmail 32468 invoked by alias); 17 Mar 2017 16:48:33 -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 32445 invoked by uid 89); 17 Mar 2017 16:48:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HTo:U*tkoenig X-HELO: mail.ud10.udmedia.de Received: from ud10.udmedia.de (HELO mail.ud10.udmedia.de) (194.117.254.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Mar 2017 16:48:29 +0000 Received: (qmail 31758 invoked from network); 17 Mar 2017 17:48:26 +0100 Received: from ip5b405f78.dynamic.kabel-deutschland.de (HELO x4) (ud10?360p3@91.64.95.120) by mail.ud10.udmedia.de with ESMTPSA (ECDHE-RSA-AES256-SHA encrypted, authenticated); 17 Mar 2017 17:48:26 +0100 Date: Fri, 17 Mar 2017 17:48:25 +0100 From: Markus Trippelsdorf To: Thomas Koenig Cc: "fortran@gcc.gnu.org" , gcc-patches Subject: Re: patch, libfortran] [patch, fortran] Fix PR 79956, part two, attempt 3 Message-ID: <20170317164825.GA292@x4> References: <86cf949e-5b0d-8667-7087-e5354ff25d18@netcologne.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <86cf949e-5b0d-8667-7087-e5354ff25d18@netcologne.de> On 2017.03.15 at 00:01 +0100, Thomas Koenig wrote: > Hello world, > > well, here is the third attempt at fixing the second part of the PR. > Glancing over the source, I think there are quite a few places where > we currently issue a runtime error which we could replace by an > assert, but that's something for 8.0. > > Regression-tested on x86_64-pc-linux-gnu. > Index: generated/reshape_c10.c > =================================================================== > --- generated/reshape_c10.c (Revision 245760) > +++ generated/reshape_c10.c (Arbeitskopie) > @@ -232,6 +232,11 @@ reshape_c10 (gfc_array_c10 * const restrict ret, > } > > sdim = GFC_DESCRIPTOR_RANK (source); > + > + /* sdim is always > 0; this lets the compiler optimize more and > + avoids a warning. */ > + GFC_ASSERT(sdim>0); > + You have committed a different patch, which is obviously wrong: diff --git a/libgfortran/generated/reshape_c10.c b/libgfortran/generated/reshape_c10.c index 00c64aeb746f..af45e960ee7f 100644 --- a/libgfortran/generated/reshape_c10.c +++ b/libgfortran/generated/reshape_c10.c @@ -78,6 +78,10 @@ reshape_c10 (gfc_array_c10 * const restrict ret, index_type shape_data[GFC_MAX_DIMENSIONS]; rdim = GFC_DESCRIPTOR_EXTENT(shape,0); + /* rdim is always > 0; this lets the compiler optimize more and + avoids a potential warning. */ + GFC_ASSERT(sdim>0); You should use rdim not sdim in the GFC_ASSERT. -- Markus