From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60870 invoked by alias); 8 Jul 2016 09:05:12 -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 60826 invoked by uid 89); 8 Jul 2016 09:05:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=U*fortran, fortran@gcc.gnu.org, fortrangccgnuorg X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 Jul 2016 09:05:10 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C63EF3F72C; Fri, 8 Jul 2016 09:05:08 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-204-98.brq.redhat.com [10.40.204.98]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u689573Y026698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Jul 2016 05:05:08 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u68955e9006259; Fri, 8 Jul 2016 11:05:05 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u68953ZT006258; Fri, 8 Jul 2016 11:05:03 +0200 Date: Fri, 08 Jul 2016 09:05:00 -0000 From: Jakub Jelinek To: Jan Hubicka , fortran@gcc.gnu.org Cc: Martin =?utf-8?B?TGnFoWth?= , Richard Biener , GCC Patches , Dominique Dhumieres , williamclodius@gmail.com Subject: Re: [PATCH 0/2, fortran] Better code generation for DO loops with +-1 step Message-ID: <20160708090503.GA7387@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20160707144035.GA30837@kam.mff.cuni.cz> <20160708084029.GZ7387@tucnak.redhat.com> <20160708090334.GJ69430@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160708090334.GJ69430@kam.mff.cuni.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2016-07/txt/msg00029.txt.bz2 On Fri, Jul 08, 2016 at 11:03:35AM +0200, Jan Hubicka wrote: > > On Fri, Jul 08, 2016 at 10:33:45AM +0200, Martin Liška wrote: > > > On 07/07/2016 04:40 PM, Jan Hubicka wrote: > > > >> > > > >> Why is the behavior only undefined for step 1 if the last iteration IV > > > >> increment overflows? > > > >> Doesn't this apply to all step values? > > > > > > > > This is what Fortran standard says: > > > > > > > > The iteration count is established and is the value of the expression (m2-m1+m3)/m3 unless that value is negative, > > > > in which case the iteration count is 0. > > > > > > > > My reading of this is that the do statement is undefined whenever the expression above is undefined > > > > (m1 is lower bound, m2 is upper bound, m3 is step) and because I think the evaulation order of > > > > m2-m1+m3 is not fixed, I think the statement is not defined whethever (m2-m1), (m1+m3) or (m2-m1)+m3 > > > > m1+m3? Did you mean m3-m1 or -m1+m3 instead? > > Ah yes, -m1+m3. But I am by no means language expert - this was meant as a heads up to Fortran > people :) Heads up to Fortran people should be sent to fortran@gcc.gnu.org ;) Jakub