Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Register unions Message-ID: <8741@smoke.BRL.MIL> Date: 23 Oct 88 21:16:19 GMT References: <322@hrc.UUCP> <2699@hound.UUCP> <976@l.cc.purdue.edu> <8724@smoke.BRL.MIL> <981@l.cc.purdue.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15 >> In article <976@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes: >> >One complaint that I have about the C compilers I have used is that they >> >do not support register unions. The point is, on many architectures not all basic data types could actually share a register. Your original example was of an integer and a floating type sharing a register, which doesn't work on any machines I'm aware of. And obviously a union of large types would not fit into a register. Simply permitting "register" to be crammed on the front of "union" would do no good; the hardware would have to actually support the usage for this to be worthwhile. If the hardware DOES support this, its C implementation is allowed to use an actual register (so long as the address is not taken). Good optimizing C compilers ignore the "register" specifiers and do their own register allocation anyway.