From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10613 invoked by alias); 16 Oct 2002 02:11:24 -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 10595 invoked from network); 16 Oct 2002 02:11:23 -0000 Received: from unknown (HELO egil.codesourcery.com) (66.92.14.122) by sources.redhat.com with SMTP; 16 Oct 2002 02:11:23 -0000 Received: from zack by egil.codesourcery.com with local (Exim 3.36 #1 (Debian)) id 181deZ-0007af-00; Tue, 15 Oct 2002 19:11:19 -0700 Date: Tue, 15 Oct 2002 23:57:00 -0000 From: Zack Weinberg To: Robert Dewar Cc: kevinlawton2001@yahoo.com, matz@suse.de, egcs@tantalophile.demon.co.uk, gcc@gcc.gnu.org Subject: Re: Request of new __attribute__ for switch statements (elimination of the bounds check) Message-ID: <20021016021119.GR15067@codesourcery.com> References: <20021016014121.4C655F2941@nile.gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021016014121.4C655F2941@nile.gnat.com> User-Agent: Mutt/1.4i X-SW-Source: 2002-10/txt/msg00915.txt.bz2 On Tue, Oct 15, 2002 at 09:41:21PM -0400, Robert Dewar wrote: > > > It's just that I see removing the bounds checks on a switch statement > > > as a marginal optimization compared to the risk. I've never seen a > > > switch be the bottleneck in anything. > > I find this a remkarable attitude for a C compiler :-) > > Even Ada allows the programmer to remove all checks if that is what the > programmer wants! > > After all in a safety critical program, such checks would not be permitted, > because you simply cannot have a check that always succeeds, and whose > failure branch is therefore deactivated code. Good point. I withdraw this objection. zw