mirror of
git://c9x.me/qbe.git
synced 2026-04-06 18:39:48 +00:00
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
2
sysv.c
2
sysv.c
@ -92,7 +92,7 @@ retr(Ref reg[2], AClass *aret)
|
|||||||
|
|
||||||
nr[0] = nr[1] = 0;
|
nr[0] = nr[1] = 0;
|
||||||
ca = 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]);
|
k = KBASE(aret->cls[n]);
|
||||||
reg[n] = TMP(retreg[k][nr[k]++]);
|
reg[n] = TMP(retreg[k][nr[k]++]);
|
||||||
ca += 1 << (2 * k);
|
ca += 1 << (2 * k);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user