Ticket #544 (Fixed)Thu Feb 03 21:34:26 UTC 2022
cc 5.88: __return_address() can be broken by tail-call optimisation or -APCS /nofp
Reported by: | Jeffrey Lee (213) | Severity: | Normal |
Part: | RISC OS: C/C++ toolchain | Release: | |
Milestone: | Status | Fixed |
Details by Jeffrey Lee (213):
In some situations the __return_address() intrinsic will read from a nonsense stack offset.
When compiling the sample code with “cc -S test.c” and examining the output, the “tailcall” function is broken, suggesting a problem with tail-call optimised functions.
When compiling with “cc -S -APCS /nofp test.c”, both “tailcall” and “normal” are broken, suggesting a problem with functions which have a stack frame but no frame pointer register.
Changelog:
Modified by Jeffrey Lee (213) Thu, February 03 2022 - 21:34:46 GMT
- Attachment added: test
Sample code
Modified by Jeffrey Lee (213) Sat, February 19 2022 - 12:03:57 GMT
- Status changed from Open to Fixed
Appears to be fixed in cc 5.89 (DDE30d)