This is the mail archive of the
mailing list for the glibc project.
Re: Avoid use of "register" as optimization hint
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 7 Jun 2013 14:58:03 -0700 (PDT)
- Subject: Re: Avoid use of "register" as optimization hint
- References: <Pine dot LNX dot 4 dot 64 dot 1306051516480 dot 14749 at digraph dot polyomino dot org dot uk>
> * Code from GMP, which also has lots of uses of "register". I don't
> know if GMP upstream has since cleaned them up; we don't actually
> try to stay in sync with GMP upstream (updating GMP code from there
> would require FSF permission to use the current GMP versions of the
> relevant code under LGPLv2.1+).
I think the permission granted way back when applies just as well to newer
GMP versions. If you have a particular reason to think it wouldn't, then
you should ask the appropriate FSF contact. But I'm confident enough to
just do whatever we want with FSF-owned code from recent GMP versions.
> * Cases where use of "register" on a variable seems to serve as
> documentation that this variable is being used as an asm input or
> output that needs to be in a register for the asm, although not
> assigned to a particular register, rather than being used as an
> obsolete optimization hint.
I don't really think this should be an exception. The asm constraint is
what matters, and the "register" keyword as implicit documentation does not
really seem like it adds anything. (In fact, it seems more likely to be
left behind as bit rot when the code changes later than to really be
helpful to anyone reading the code.)
Neither of these constitutes anything wrong with the change you've posted
(just more that can be done in the future). I think it's fine as it is.