|
|||||||||||
Technical Support Support Resources
Product Information |
C51: Preventing Common Block OptimizationInformation in this article applies to:
QUESTIONWe have written a custom implementation of the setjmp function to solve some problems in our application. We are also using the highest optimization level with Linker Code Packing and we have a problem. The compiler and linker optimize the setjmp function calls and this causes problems for our application. Is there a way to exclude a part of our code from optimization? ANSWERYes. You may specify a different optimization level for the routine that contains the setjmp call. For example:
The SAVE and OPTIMIZE pragmas save the current configuration and change the optimizer level to 7. The RESTORE pragma restores the previous optimizer level. Use these around your functions that use setjmp and common block subroutine optimization will be disabled (for these functions). Note: It is not enough to reduce the optimization level to 8, since the compiler (or linker) would still combine code sections with other functions that are translated with optimize level 9 or higher. MORE INFORMATION
SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.