In the next branch, a new test-s08-stack auto regression test target has been added. There are quite some failing tests. It looks like most of them are in tests that use types wider than 32 bits (i.e. (unsigned) long long and \BitInt(N) for N > 32).
It looks like the problem here is in the long long shifts. These are converted to calls to support routines, which expect an 8-bit value as right parameter. But they get passed a 64-bit value as right parameter.
Without --stack-auto, this was not a problem, as the extra bytes were just ignored by the callee. But with --stack-auto, this means that stack offsets are off.
P.S.: Sample that shows the issue:
unsigned long long ll;
void g(void)
{
ll <<= 3;
}
The 3 gets passed as 64-bit value.
Last edit: Philipp Klaus Krause 2023-05-31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It looks like the problem here is in the long long shifts. These are converted to calls to support routines, which expect an 8-bit value as right parameter. But they get passed a 64-bit value as right parameter.
Without --stack-auto, this was not a problem, as the extra bytes were just ignored by the callee. But with --stack-auto, this means that stack offsets are off.
P.S.: Sample that shows the issue:
The 3 gets passed as 64-bit value.
Last edit: Philipp Klaus Krause 2023-05-31
Fixed in [r14119] in the next branch. The number of s08-stack-auto failures is now down to 33.
Related
Commit: [r14119]
Fixed in [r14211] by merging next to trunk.
Related
Commit: [r14211]