Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!agate!shelby!neon!neon.Stanford.EDU!ham From: ham@Neon.Stanford.EDU (Peter R. Ham) Newsgroups: comp.sys.mips Subject: Can some one explain this compiler output? Message-ID: Date: 12 Nov 89 00:12:38 GMT Sender: USENET News System Distribution: comp Organization: Stanford University Lines: 49 Question: Why does cc allocate 24 bytes of stack for a non-leaf procedure with no local variables when calling another procedure that accepts no arguments? Given this C code: extern void bar(); void foo() { bar(); } cc produces: .verstamp 1 31 .text .align 2 .file 2 "test.c" .globl foo .loc 2 6 # 1 # 2 extern void bar(); # 3 # 4 void # 5 foo() # 6 { .ent foo 2 foo: .option O2 subu $sp, 24 sw $31, 20($sp) .mask 0x80000000, -4 .frame $sp, 24, $31 .loc 2 7 # 7 bar(); jal bar .loc 2 8 # 8 } lw $31, 20($sp) addu $sp, 24 j $31 .end foo -- Peter Ham PO Box 3430 (h)(415) 322-4390 MS Computer Science Student Stanford, CA ham@cs.stanford.edu Stanford University 94309 (o)(415) 723-2067