Path: utzoo!mnetor!uunet!oddjob!hao!husc6!tut.cis.ohio-state.edu!ut-sally!utah-cs!utah-gr!uplherc!sp7040!obie!wes From: wes@obie.UUCP (Barnacle Wes) Newsgroups: comp.lang.c Subject: Re: register unions Message-ID: <77@obie.UUCP> Date: 26 Feb 88 06:52:29 GMT References: <1229@eneevax.UUCP> <10075@ulysses.homer.nj.att.com> <41964@sun.uucp> Distribution: comp.lang.c Organization: UinTech, Layton, UT Lines: 29 Keywords: registers, unions Summary: Varying register usage... In article <41964@sun.uucp>, guy@gorodish.Sun.COM (Guy Harris) writes: > > The official AT&T version of the K&R portable C compiler only > > supports register allocation of int's. All other types are > > silently assigned to core. > > I presume you mean "integral types", not "int"s. The version of PCC2 that > comes with S5R3.1 on 3B2s, for instance, quite cheerfully puts "short"s, > "char"s, and "long"s into registers as well. A lot of this type of problem is caused by the underlying machine architecture. On the M68000, you usually have 5 or 6 address registers available, so most 68K C compilers let you put pointers in registers as well as integral types. The one I use the most (MWC for Atari ST) does not allow floats of any flavor to be put in registers. On Intel chips, a pointer in a register isn't really defined; there are no real general-purpose registers, and there aren't any registers big enough to hold a full address. I guess you could probably put an address is ES:DI or something like that, but I don't know of any compilers that do. MicroPort's pcc surely doesn't! ---- "Segments are for worms!" -- Landon Dyer -- /\ - "Against Stupidity, - {backbones}! /\/\ . /\ - The Gods Themselves - utah-cs!utah-gr! / \/ \/\/ \ - Contend in Vain." - uplherc!sp7040! / U i n T e c h \ - Schiller - obie!wes