This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Request of new __attribute__ for switch statements (elimination of the bounds check)
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: kevinlawton2001 at yahoo dot com, matz at suse dot de, egcs at tantalophile dot demon dot co dot uk,gcc at gcc dot gnu dot org
- Date: Tue, 15 Oct 2002 19:11:19 -0700
- Subject: Re: Request of new __attribute__ for switch statements (elimination of the bounds check)
- References: <20021016014121.4C655F2941@nile.gnat.com>
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