What is the correct logic for casesi

Jim Wilson wilson@tuliptree.org
Mon Aug 11 20:55:00 GMT 2003


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



More information about the Gcc mailing list