This is the mail archive of the
mailing list for the GCC project.
Re: What is the correct logic for casesi
- From: Jim Wilson <wilson at tuliptree dot org>
- To: Marty Hauff <marty dot hauff at rmit dot edu dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 11 Aug 2003 13:40:14 -0700
- Subject: Re: What is the correct logic for casesi
- References: <email@example.com>
Marty Hauff wrote:
I'm a bit confused by the documentation and some of the other MD file implementations of casesi..
Is this the correct (Pseudo code) logic for casesi?
No. upper_bound is op2+op3, not op3. See the documentation and other
MD file implementations. The table jump entry size is specified
separately, and is not necessarily the same size as Pmode. Otherwise
this looks reasonable.
The best reference is the source. If you are having problems, step
through the code that generates casesi for switch statements. See
expand_end_case_type in stmt.c and the try_casesi function in expr.c.
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com