This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to avoid generate _ARM_common_switch8 in switch case

Dear all

I would like to avoid generation on "_ARM_common_switch8" in switch case / MDK ARM.

I cannot change the source code because of its porting past product.

it may be difficult to use compiler optimization without impact other part.

Could you let me know any good way to solve ?

Any information much appreciated.

Best regards

Parents
  • someone wrote

    When you use more than 7 switch-cases, compile would call this library function-'ARM_COMMON_SWITCH8' to help compute the address that program would switch to.

    There are two known methods to solve this problem. One is dividing your switch structure into several smaller 'condition structure' such as 'if and else' and switch structure with less than 6 cases. The second method is using optimization options such as '-O1,-O2,-O3,-Os'.

Reply
  • someone wrote

    When you use more than 7 switch-cases, compile would call this library function-'ARM_COMMON_SWITCH8' to help compute the address that program would switch to.

    There are two known methods to solve this problem. One is dividing your switch structure into several smaller 'condition structure' such as 'if and else' and switch structure with less than 6 cases. The second method is using optimization options such as '-O1,-O2,-O3,-Os'.

Children