GCC provides a couple of special builtin functions to aid in the writing of interrupt handlers in C.
__bic_SR_register_on_exit (int
mask)
__bis_SR_register_on_exit (int
mask)
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gcc/MSP430-Built_002din-Functions.html