From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8425 invoked by alias); 14 Oct 2002 12:44:06 -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 8406 invoked from network); 14 Oct 2002 12:44:02 -0000 Received: from unknown (HELO faui80.informatik.uni-erlangen.de) (131.188.38.1) by sources.redhat.com with SMTP; 14 Oct 2002 12:44:02 -0000 Received: from rz.de (faui80 [131.188.38.1]) by faui80.informatik.uni-erlangen.de (8.9.1a/8.1.13-FAU) with ESMTP id OAA29515; Mon, 14 Oct 2002 14:44:00 +0200 (MEST) Received: (from rz@localhost) by rz.de (8.8.8/8.8.8) id XAA00663; Sun, 13 Oct 2002 23:58:38 +0200 Date: Mon, 14 Oct 2002 08:31:00 -0000 From: Richard Zidlicky To: Kevin Lawton Cc: gcc@gcc.gnu.org Subject: Re: Request of new __attribute__ for switch statements (elimination of the bounds check) Message-ID: <20021013235837.A657@linux-m68k.org> References: <20021011190521.57024.qmail@web80309.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021011190521.57024.qmail@web80309.mail.yahoo.com>; from kevinlawton2001@yahoo.com on Fri, Oct 11, 2002 at 12:05:21PM -0700 X-SW-Source: 2002-10/txt/msg00694.txt.bz2 On Fri, Oct 11, 2002 at 12:05:21PM -0700, Kevin Lawton wrote: > All, > > For implementation of machine simulators, it's quite common > to have completely populated switch statements on byte values: > > unsigned char byte; > > switch (byte) { > case 0: > case 1: > ... > case 255: > } > > But I don't know of any way to tell the compiler to _not_ generate > a bounds check on the switch variable 'byte'. All of the target > space is covered. did you look into using gcc's computed goto? Richard