From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3628 invoked by alias); 1 Dec 2004 03:22:01 -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 3583 invoked from network); 1 Dec 2004 03:21:55 -0000 Received: from unknown (HELO rwcrmhc12.comcast.net) (216.148.227.85) by sourceware.org with SMTP; 1 Dec 2004 03:21:55 -0000 Received: from [10.0.1.2] (h000393256f12.ne.client2.attbi.com[24.61.199.96]) by comcast.net (rwcrmhc12) with SMTP id <2004120103215401400032tse>; Wed, 1 Dec 2004 03:21:55 +0000 User-Agent: Microsoft-Entourage/11.1.0.040913 Date: Wed, 01 Dec 2004 03:22:00 -0000 Subject: Re: INT_MIN % -1 From: Paul Schlie To: Robert Dewar CC: Message-ID: In-Reply-To: <41AD12C6.4010402@gnat.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SW-Source: 2004-12/txt/msg00009.txt.bz2 > From: Robert Dewar > > Paul Schlie wrote: >> With reference to the below: >> >> I would guess that rather than attempting to expose a check for a / or % by >> -1 to the compiler, I would assume that it's best handled by the back end >> during code generations, as the most efficient solution is target specific: > > Indeed, but remember we would need to have both operations, one with the > special handling and one without. Understood, as ADA programs may bound the domain of it's variables guaranteeing that the operation would be well behaved within the bounds of it's operands; but wonder if saving a few cycles out of the likely several required for a divide or modulo operation would likely be worth the added, albeit minor, complexity?