Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles; site uokvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!inuxc!pur-ee!uiucdcs!parsec!ctvax!uokvax!emjej From: emjej@uokvax.UUCP Newsgroups: net.lang Subject: function call implementation query - (nf) Message-ID: <9000023@uokvax.UUCP> Date: Mon, 23-Apr-84 13:35:00 EST Article-I.D.: uokvax.9000023 Posted: Mon Apr 23 13:35:00 1984 Date-Received: Fri, 27-Apr-84 03:55:24 EST Lines: 32 Nf-ID: #N:uokvax:9000023:000:1277 Nf-From: uokvax!emjej Apr 23 12:35:00 1984 #N:uokvax:9000023:000:1277 uokvax!emjej Apr 23 12:35:00 1984 I have implemented a code generator which uses the convention of "caller saves whatever registers it wants saved." This convention typically works very well (especially since often there are no such registers, and thank you, Guy Steele, wherever you are, for writing "The Myth of the Expensive Procedure Call, or Lambda: the Ultimate GOTO"), but sometimes, I find call FOO call BAR ... and I want to collapse the consecutive restore/save (or keep only deltas, such as the register that no doubt contains the result of FOO). (Oh, yes; this is for a C compiler, by the way, and the compiler as it stands may well generate *worse* code if you use register variables with reckless abandon!) Has anyone done this sort of thing? Please mail responses, and I'll summarize after a reasonable interval (about 2 weeks, I reckon). James Jones Come to think of it, here is as good a place as any for me to partially recant previous rantings of mine about C. Even though the pre/post increment/decrement operators *are* inspired by the PDP-11, it is not too hard to implement them without those addressing modes quite respectably. (No doubt everybody knew this already, but confession is good for the soul.)