Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!riley From: riley@batcomputer.tn.cornell.edu (Daniel S. Riley) Newsgroups: comp.sys.amiga.tech Subject: Re: Registers Message-ID: <9521@batcomputer.tn.cornell.edu> Date: 10 Jan 90 16:39:00 GMT References: <89122504041615@masnet.uucp> <15315@well.UUCP> Reply-To: riley@tcgould.tn.cornell.edu (Daniel S. Riley) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 28 In article <15315@well.UUCP> farren@well.UUCP (Mike Farren) writes: >Mike (With friends like these, who needs hallucinations) Meyer writes: >>The [Lattice] compiler thinks it can do a better job of keeping stuff in >>the registers by using them as cache than you can by tagging specific >>variables as registers. >O.K., but is it correct? Has anyone done an analysis of Lattice code >to be able to tell if this is Good or Bad? I don't think the Lattice compiler completely ignores "register" declarations. It may take them as advisory information only, but I have certainly seen code change with 5.0 when I changed what variables were declared register. Does it do a good job? Yes, in most cases. I have found that I usually get the best code by not declaring any register variables and letting the optimizer do its work. In some special cases, it helps to give the optimizer some hints by declaring register variables, but generally it does a pretty good job. As a side note on "register" and program semantics, remember that you can't take the address of a register variable. Some compilers that don't otherwise respect register declarations use this information to modify the assumptions made by the optimizer (I believe the MIPS C compiler does this). -Dan Riley (riley@tcgould.tn.cornell.edu, cornell!batcomputer!riley) -Wilson Lab, Cornell University