-
Notifications
You must be signed in to change notification settings - Fork 59
FAQ
register allocation: no more register to allocate “ ra.357”
This message says that there are no free registers for storing the return address of some function
(its name is a white space followed by ra
).
Which function? With the command-line flag -debug
on, the compiler will output the required information
(grep
for the actual name of the variable to filter the too verbose output).
There are two possible kinds of fix to this kind of issue: either spill some registers to ensure there is at least one register that is free at all call sites; or change the calling-convention of the function so that return address is passed on the stack
(this can be achieved through the #returnaddress=stack
annotation before the function declaration).
For setting variables to zero, Jasmin has the special #set0()
intrinsic.
For example:
reg u64 i;
i = #set0();
while (i < 256) {
// ...
i += 1;
}