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: Richard Henderson <rth at redhat dot com>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: Zack Weinberg <zack at codesourcery 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: Wed, 16 Oct 2002 13:23:31 -0700
- Subject: Re: Request of new __attribute__ for switch statements (elimination of the bounds check)
- References: <20021016004929.GO15067@codesourcery.com> <F202BFD8-E0A2-11D6-B07C-000393D76DAA@apple.com>
On Tue, Oct 15, 2002 at 06:02:30PM -0700, Dale Johannesen wrote:
> 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.
I agree. And it does seem like we shouldn't need VRP to handle
the cases where a small type or a range-limiting operation (such
as & or %) is used in the switch selector directly.
r~