Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Dec 2000 16:11:59 -0500
From:      "Brian F. Feldman" <green@FreeBSD.org>
To:        Peter Wemm <peter@netplex.com.au>
Cc:        John Baldwin <jhb@FreeBSD.org>, Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/tail forward.c read.c reverse.c tail 
Message-ID:  <200012042112.eB4LBx736905@green.dyndns.org>
In-Reply-To: Message from Peter Wemm <peter@netplex.com.au>  of "Mon, 04 Dec 2000 11:55:32 PST." <200012041955.eB4JtWJ11058@mobile.wemm.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm <peter@netplex.com.au> wrote:
> John Baldwin wrote:
> > 
> > On 03-Dec-00 Jeroen Ruigrok van der Werven wrote:
> > > asmodai     2000/12/03 09:05:45 PST
> > > 
> > >   Modified files:
> > >     usr.bin/tail         forward.c read.c reverse.c tail.c 
> > >   Log:
> > >   Remove register keyword usage with prejudice.
> > >   Modern compilers are smarter when it comes to allocating register
> > >   usage.
> > 
> > They also ignore the register keyword, so this is a rather pointless change,
> > although it does add to repo bloat and in more active code could make diffs
> > harder to read.  :-/
> 
> It doesn't actually ignore it.  Try this:
> 
> register int foo;
> printf("%p\n", &foo);
> 
> This does get in the way at times, which is why people remove it.

For example, converting macros to side-effect-safe (macros|inline functions).
#define M_PREPEND(m, plen, how) do {                                    \
        struct mbuf **_mmp = &(m);                                      \
is my example for why it's useful not to try to force the compiler into 
using registers.  Besides, I only know of one case when a register keyword 
does something: register reg_type variable __asm__("reg").  Even in that 
case, it's useless because that declaration will be optimized by the 
compiler (volatile doesn't help) and made useless in the process by taking 
away the special treatment of it.  So I can't see any use of register.

--
 Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
 green@FreeBSD.org                    `------------------------------'




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012042112.eB4LBx736905>