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: Dale Johannesen <dalej at apple dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Dale Johannesen <dalej at apple dot com>, Michael Matz <matz at suse dot de>, Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>, Kevin Lawton <kevinlawton2001 at yahoo dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 15 Oct 2002 18:02:30 -0700
- Subject: Re: Request of new __attribute__ for switch statements (elimination of the bounds check)
On Tuesday, October 15, 2002, at 05:49 PM, Zack Weinberg 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 have. However, it was a switch on (x&7) with 8 cases, not an enum.
I do not think new syntax is the right way to fix this case, which
demonstrates an optimizer deficiency.