From patchwork Mon May 1 17:21:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 757228 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 3wGrmx35fsz9s8H for ; Tue, 2 May 2017 03:21:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Za/4Ssc0"; 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; q=dns; s= default; b=bYH3qdbftPaHMvMqp2WkrmRgOt2VKlE12SiTj5F9zYrvK6Cy0W7bC dH5Zq47IkOgjPvZllyoWB/QaHGuQXqgm89hvMe3Q95BjKTBziFwAKsykk1pe8R7w tVe5zCdSYsEV8NAyiASmMRYiF/dfHihbyKTbPwWjAolKSHGbWyHXqU= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=default; bh=iauEQklVexuZEQiWQ9dE38OYKBI=; b=Za/4Ssc0W/90K5Qsnr2T3Nfr34l4 Jp66RB3CKt8gzWfa7mbzVOpB2SyNKYIMuhKBaXGkooAgFht/bXc0wj83d17sJm7H KH9K8OTBf8wRoT0bIieyxdGdUHC/wjU2ud1GXKhffC1FBOnc8FYpJqe9VjyycVd8 xUq1ZgEpmfWM+34= Received: (qmail 115602 invoked by alias); 1 May 2017 17:21:11 -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 115574 invoked by uid 89); 1 May 2017 17:21:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:b5ac43f X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout1.netcologne.de Received: from cc-smtpout1.netcologne.de (HELO cc-smtpout1.netcologne.de) (89.1.8.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 May 2017 17:21:08 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id E2EC413130; Mon, 1 May 2017 19:21:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id DCF4411DDE; Mon, 1 May 2017 19:21:06 +0200 (CEST) Received: from [78.35.155.8] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 59076e82-022c-7f0000012729-7f000001d256-1 for ; Mon, 01 May 2017 19:21:06 +0200 Received: from [192.168.178.20] (xdsl-78-35-155-8.netcologne.de [78.35.155.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Mon, 1 May 2017 19:21:03 +0200 (CEST) Subject: Re: [patch, fortran] Check bounds for matrix-vector multiplication To: sgk@troutmask.apl.washington.edu References: <20170501164025.GA51744@troutmask.apl.washington.edu> Cc: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Message-ID: <05e6ea3e-4d09-0b0a-0623-3525d90daf53@netcologne.de> Date: Mon, 1 May 2017 19:21:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170501164025.GA51744@troutmask.apl.washington.edu> Hi Steve, > Why the duplicate code? Seems like an OR is needed. You are quite right. Here's an updated patch: gfc_expr *a2, *b1; OK for trunk? Regards Thomas Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 247003) +++ frontend-passes.c (Arbeitskopie) @@ -3066,9 +3066,10 @@ gfc_code *lhs_alloc; /* Only need to check a single dimension for the A2B2 case for - bounds checking, the rest will be allocated. */ + bounds checking, the rest will be allocated. Also check this + for A2B1. */ - if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS && m_case == A2B2) + if ((gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) && (m_case == A2B2 || m_case == A2B1)) { gfc_code *test;