On Wed, Aug 6, 2008 at 8:30 PM, Jonathan Worthington <[EMAIL PROTECTED]>wrote:
> Will Coleda wrote: > >> Can you describe a situation where this occurs that isn't a bug in the >> register allocator? >> >> > Yes. IIRC, it was added when I was working on the .Net bytecode translator, > and it needed to take references to registers in callers. If you're doing > that, you need to know that the register won't get re-used once the > reference has been taken, or you'll end up with a reference to the wrong > register. Named registers holding things that references were being taken > to, were marked with :unique_reg, to make sure this didn't happen. > > It also, as Pm mentioned, works as a hint to the register allocator not to > bother trying to allocate something that will have life over the entire > compilation unit anyway. > > Jonathan > > That sounds like a good reason. Correct me if I'm wrong, (just to get this clear in my head) but this sounds a bit like the "register" keyword in C, except that C's "register" is more like a hint, so that the compiler is not obliged to do anything with it. kjs