Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/17/84; site opus.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!hao!nbires!opus!rcd
From: rcd@opus.UUCP (Dick Dunn)
Newsgroups: net.lang.c
Subject: Re: register variables
Message-ID: <1271@opus.UUCP>
Date: Wed, 3-Jul-85 20:49:33 EDT
Article-I.D.: opus.1271
Posted: Wed Jul  3 20:49:33 1985
Date-Received: Sat, 6-Jul-85 10:41:08 EDT
References: <409@umcp-cs.UUCP>
Distribution: net
Organization: NBI,Inc, Boulder CO
Lines: 22

> I have to admit to getting into the sloppy habit of stopping after
> six register declarations.  But that's not why I'm writing this.
> . . what I really want to do is make another point here, and that
> is that you should declare register variables before ordinary
> variables (in general), since some machines (Pyramids) ignore the
> word ``register'' and just put the first N (12) variables in
> registers.  (Such a machine must, of course, be able to take the
> address of a register.)

Sounds like the Pyramid compiler has a problem there, to the extent that
it's not following the spirit of the `register' declaration.  Who ever said
that "order of declaration" is a hint to the compiler on which variables
are most frequently used?!

Also, it's not generally possible to declare register variables before
ordinary variables--parameters are effectively just initialized local
variables, but the syntax requires that they all be declared before any of
the locals.  The parameter-vs-local distinction is another reason that
compilers ought not to do what the Pyramid compiler is described as doing.
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...A friend of the devil is a friend of mine.