Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!world!iecc!compilers-sender From: Tom.Lane@G.GP.CS.CMU.EDU Newsgroups: comp.compilers Subject: Re: Portable Fast Direct Threaded Code Keywords: interpreter, design Message-ID: <18809.670519274@G.GP.CS.CMU.EDU> Date: 1 Apr 91 15:21:14 GMT References: <3035@redstar.cs.qmw.ac.uk> <1991Mar31.180635.5944@cs.rochester.edu> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: Tom.Lane@G.GP.CS.CMU.EDU Organization: Compilers Central Lines: 21 Approved: compilers@iecc.cambridge.ma.us Lawrence Crowl points out one important problem with Eliot Miranda's scheme for global register use in C. There's an even more fundamental problem, though: there is *no guarantee whatever* that the compiler will assign the same registers to the global variables in every routine. Compilers that do intelligent allocation of variables to registers may refuse to honor the "register" declarations at all if the global variables are not heavily used in a given routine, and in any case the globals need not be assigned to the same registers every time. Miranda's scheme thus relies heavily on the assumption of a dumb register allocator (or else a compiler that supports global register variable declarations). This scheme may be "fast" direct threaded code, but it's hardly "portable". -- tom lane Internet: tgl@cs.cmu.edu BITNET: tgl%cs.cmu.edu@cmuccvma [GCC lets you specify what register to use for global register variables, but that is of course both machine and compiler specific. -John] -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.