-
Notifications
You must be signed in to change notification settings - Fork 32
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
ARM segfault during multiply #762
Comments
I don't think I ever pushed a version of the ARMv7 register assignments that used I'm leaving this issue open because I don't understand why we can't use |
This looks like it has been a latent bug in the ARM code generator, but I didn't find it until I tried to free up another ARM register by using
sp
asSTKP
.The newly aggressive register assignment seemed to be working fine until a segfault occurred while compiling
27.sld
. That library just imports the R6RS version, and the segfault occurred while reading compiled code for the R6RS version. The segfault is more easily reproduced by evaluating(string->number "1403580.0")
. Here is the relevant machine code:The code generated by
cant.mul/bnv
assumedSTKP
is a general register that can be used as a scratch register provided it is saved and restored. Now thatSTKP
issp
, however, we must maintain the multiple-of-4 stack alignment at all times.But there's another problem: The conditional branch at 0xb660c388 above can skip over the instruction that restoresSTKP
, regardless of whetherSTKP
issp
. That conditional branch wasn't generated directly bycant.mul/bnv
, so it must have been added by the optimizer. That probably means there's a bug in the ARM machine code optimizer as well.Or maybe the optimizer was correct untilSTKP
becamesp
. Either way, it's a bug now.No, the optimizer's okay. The conditional branch won't be executed if
sp
has been clobbered. So it looks as though this may just be a violation of thesp
invariant, with processor-dependent behavior.The text was updated successfully, but these errors were encountered: