simplify a buggy test
I found it by compiling -O2 and seeing the ABI code fail. Further investigation revealed GCC trimmed away the last iteration of the loop because I was accessing the third element of an array of size two. This is undefined behavior, so GCC "proved" that the last iteration was never run.
This commit is contained in:
parent
a7fb69fd78
commit
15cee065a5
1 changed files with 1 additions and 1 deletions
2
sysv.c
2
sysv.c
|
@ -92,7 +92,7 @@ retr(Ref reg[2], AClass *aret)
|
|||
|
||||
nr[0] = nr[1] = 0;
|
||||
ca = 0;
|
||||
for (n=0; aret->cls[n]>=0 && n<2; n++) {
|
||||
for (n=0; (uint)n*8<aret->size; n++) {
|
||||
k = KBASE(aret->cls[n]);
|
||||
reg[n] = TMP(retreg[k][nr[k]++]);
|
||||
ca += 1 << (2 * k);
|
||||
|
|
Loading…
Add table
Reference in a new issue