This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What is the correct logic for casesi


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]