Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 SMI; site sun.uucp Path: utzoo!linus!decvax!decwrl!sun!gnu From: gnu@sun.uucp (John Gilmore) Newsgroups: net.micro.68k Subject: nargs not possible with optimized code Message-ID: <401@sun.uucp> Date: Wed, 28-Dec-83 11:57:16 EST Article-I.D.: sun.401 Posted: Wed Dec 28 11:57:16 1983 Date-Received: Thu, 29-Dec-83 01:19:20 EST References: <363@sii.UUCP> Organization: Sun Microsystems, Inc. Lines: 25 We used to run Unisoft Unix and even a year ago their C optimizer would optimize out the stack-adjusting instructions where possible. For example, it would turn: movl arg,sp@- jsr subr addql #4,sp <-- the instruction nargs() looks for movl arg2,sp@- jsr subr2 addql #4,sp <-- the instruction nargs() looks for into: movl arg,sp@- jsr subr movl arg2,sp@ <-- the instruction is gone... jsr subr2 addql #4,sp Unless your calling sequence is specifically designed to support "nargs", it can't be relied on. The "standard" 68000 C calling sequence (designed by Jack Test at MIT?) doesn't support it -- rightly, I think. Part of the reason subroutine calls were so expensive on the Vax was this kind of unused generality.