srg@quick.com (Spencer Garrett) (12/12/89)
gcc 1.36 on Sun 3/50 flags -S -O
unoptimized code appears to be correct.
the optimized code gets b and c confused when
generating the call to sub2().
sub(n)
int n;
{
char a[3];
char b[n + 3];
char c;
sub2(a, b, c);
}
#NO_APP
gcc_compiled.:
.text
.even
.globl _sub
_sub:
link a6,#-4
movel a6@(8),d0
addql #4,d0
moveq #-2,d1
andl d1,d0
subl d0,sp
movel sp,d0 | "alloca" results are correct
extbl d0 | forgot to load c
movel d0,sp@-
movel d0,sp@- | clobbered address of b
pea a6@(-4)
jbsr _sub2
unlk a6
rts