From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2375 invoked by alias); 11 Jul 2005 15:18:26 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 2236 invoked by uid 22791); 11 Jul 2005 15:18:23 -0000 Received: from dumbledore.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.11) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 11 Jul 2005 15:18:23 +0000 Received: (qmail 2565 invoked from network); 11 Jul 2005 15:18:21 -0000 Received: from unknown (HELO 81-178-233-143.dsl.pipex.com) (paul@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Jul 2005 15:18:21 -0000 From: Paul Brook To: gcc@gcc.gnu.org Subject: Re: Overflow in Fortran (was: Where does the C standard describe overflow of signed integers?) Date: Mon, 11 Jul 2005 15:18:00 -0000 User-Agent: KMail/1.7.2 Cc: Nicholas Nethercote References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507111618.18768.paul@codesourcery.com> X-SW-Source: 2005-07/txt/msg00417.txt.bz2 On Monday 11 July 2005 15:58, Nicholas Nethercote wrote: > Also, does anyone know what the required behaviour for Fortran integers is > on overflow? Section 7.1.7 "Evaluation of operation" "The evaluation of any numeric operation whose result is not defined by the arithmetic used by the processor[1] is prohibited" Section 13.7.1 "Models for integer and real data" The model set for integer i is defined by: [sign + magnitude] ie. overflow is not defined, and we can do whatever the hell we want. Paul [1] In this context "processor" means language processor, ie. a combination the compiler, OS and target hardware.