diff options
author | Damien George <damien.p.george@gmail.com> | 2019-08-19 15:51:40 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-08-19 16:14:57 +1000 |
commit | 11ecdf2ec699c5f78ef7b2bc1bd34618394cc9fa (patch) | |
tree | 8e5a17980fa5476397db5f2ed6b3e478e7265208 /py/modarray.c | |
parent | 0c80cb39af7a0f6b0ad73d38bf28a8fc1f50b3c7 (diff) | |
download | micropython-11ecdf2ec699c5f78ef7b2bc1bd34618394cc9fa.tar.gz micropython-11ecdf2ec699c5f78ef7b2bc1bd34618394cc9fa.zip |
py/nlr: Use MP_UNREACHABLE at the end of arch-specific nlr_jump funcs.
Recent versions of gcc perform optimisations which can lead to the
following code from the MP_NLR_JUMP_HEAD macro being omitted:
top->ret_val = val; \
MP_NLR_RESTORE_PYSTACK(top); \
*_top_ptr = top->prev; \
This is noticeable (at least) in the unix coverage on x86-64 built with gcc
9.1.0. This is because the nlr_jump function is marked as no-return, so
gcc deduces that the above code has no effect.
Adding MP_UNREACHABLE tells the compiler that the asm code may branch
elsewhere, and so it cannot optimise away the code.
Diffstat (limited to 'py/modarray.c')
0 files changed, 0 insertions, 0 deletions