From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24109 invoked by alias); 11 Apr 2015 17:01:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 24089 invoked by uid 89); 11 Apr 2015 17:01:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout2.netcologne.de Received: from cc-smtpout2.netcologne.de (HELO cc-smtpout2.netcologne.de) (89.1.8.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 11 Apr 2015 17:01:26 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id 4360113884; Sat, 11 Apr 2015 19:01:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id 3974C11DE3; Sat, 11 Apr 2015 19:01:16 +0200 (CEST) Received: from [78.35.184.161] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.0.6) (envelope-from ) id 5529535c-0b4b-7f0000012729-7f0000019988-1 for ; Sat, 11 Apr 2015 19:01:16 +0200 Received: from [192.168.178.20] (xdsl-78-35-184-161.netcologne.de [78.35.184.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA; Sat, 11 Apr 2015 19:01:12 +0200 (CEST) Message-ID: <55295358.60707@netcologne.de> Date: Sat, 11 Apr 2015 17:01:00 -0000 From: Thomas Koenig User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Mikael Morin , =?windows-1252?Q?Dominique_d=27?= =?windows-1252?Q?Humi=E8res?= CC: GCC Patches , GNU GFortran Subject: Re: [patch, fortran, RFC] First steps towards inlining matmul References: <20150405135519.AF21A105@mailhost.lps.ens.fr> <552147A3.7000603@netcologne.de> <4DA1047C-92D3-485A-9457-61655ED14681@lps.ens.fr> <55219D1C.6070507@netcologne.de> <9F588746-B32C-4919-AEFC-4EF5E6792001@lps.ens.fr> <3916A939-23B3-4D17-B91C-8B6CC34CD7BC@lps.ens.fr> <5526FAAA.8010408@netcologne.de> <55291273.6060800@netcologne.de> <552924F2.6000406@sfr.fr> In-Reply-To: <552924F2.6000406@sfr.fr> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00508.txt.bz2 Hi Mikael, >> Still to do: Bounds checking (a rather big one), > ... as you do a front-end to front-end transformation, you get bounds > checking for free, don't you? Only partially. What the patch does is integer i,j,k c = 0 do j=0, size(b,2)-1 do k=0, size(a, 2)-1 do i=0, size(a, 1)-1 c(i * stride(c,1) + lbound(c,1), j * stride(c,2) + lbound(c,2)) = c(i * stride(c,1) + lbound(c,1), j * stride(c,2) + lbound(c,2)) + a(i * stride(a,1) + lbound(a,1), k * stride(a,2) + lbound(a,2)) * b(k * stride(b,1) + lbound(b,1), j * stride(b,2) + lbound(b,2)) end do end do end do If size(b,2) < size(c,2) or size(a,1) < size(c,1) or size(a,2) < size(b,1), this will not get caught - no array bounds violation in the DO loops, but illegal code nonetheless. Also, the error message is different, which should also be changed. What I would like to add to check before the loop, and then add a "do not bounds-check" flag to the reference. Thomas