Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setjmp/longjmp: Do NOT save r58,r59 regs #24

Open
shahab-vahedi opened this issue Jul 12, 2021 · 0 comments
Open

setjmp/longjmp: Do NOT save r58,r59 regs #24

shahab-vahedi opened this issue Jul 12, 2021 · 0 comments
Assignees

Comments

@shahab-vahedi
Copy link
Member

Registers r58 and r59 are saved during a setjmp and longjmp. This is not necessary, because ARCv2 ABI document declares them as scratch registers.

The fix concerns these files:

newlib/libc/include/machine/setjmp.h
newlib/libc/machine/arc/setjmp.S

Make sure there is no regression after this change. For starters, these are GCC tests that use setjmp and longjmp:

$ runtest execute.exp=pr56982.c dg-torture.exp=pr48542.c
@shahab-vahedi shahab-vahedi self-assigned this Jul 12, 2021
shahab-vahedi referenced this issue Jul 12, 2021
The "longjmp" expects the "setjmp" to save the r58/r59 registers,
if there is any.  With this change they are saved accordingly.

Checked for regression with running GCC's DejaGnu tests:
$ runtest execute.exp=pr56982.c dg-torture.exp=pr48542.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant