CW10 - Switch Statement code generation, V1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CW10 - Switch Statement code generation, V1

Jump to solution
779 Views
WHookway
Contributor III

Hi,

I have a large switch statement and the generated code is using stack space (80 bytes), I cannot afford this, most of my threads call this routine.  I have organized the case values to be contiguous with no improvement, I do not know why the code is not a simple jump table at this point.  I noticed that others have posted this issue with previous versions of the compiler (CW8.1) and there was a pragma called switch_tables that allowed for control of how the case statement was implemented.  Is there a way to force the code generation of the switch statement?

Thanks,

Will

Labels (1)
0 Kudos
1 Solution
312 Views
WHookway
Contributor III

Hi,

I appologize, I did not dig into this far enough.  The switch statement is building the table and the stack usage is due to another question that I will post, removing the switch statement had removed the stack usage.

Regards,

Will

View solution in original post

0 Kudos
1 Reply
313 Views
WHookway
Contributor III

Hi,

I appologize, I did not dig into this far enough.  The switch statement is building the table and the stack usage is due to another question that I will post, removing the switch statement had removed the stack usage.

Regards,

Will

0 Kudos