This is the mail archive of the
mailing list for the GCC project.
Re: Proposed doc update for Explicit Reg Vars 2/3
- From: David Wohlferd <dw at LimeGreenSocks dot com>
- To: Jeff Law <law at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, Sandra Loosemore <sandra at codesourcery dot com>
- Date: Tue, 20 Oct 2015 21:16:10 -0700
- Subject: Re: Proposed doc update for Explicit Reg Vars 2/3
- Authentication-results: sourceware.org; auth=none
- References: <561C3D44 dot 5040506 at LimeGreenSocks dot com> <5625CD44 dot 1080404 at redhat dot com>
That is helpful. It's a way signaling that things may change and that
depending on the precise syntax and semantics may be unwise.
- Eventually the compiler may work differently than it does now.
From time to time, particularly with GCC extensions, it has been
necessary to declare certain usage as invalid or to change the
implementation is significantly visible ways.
We never like doing that, but it is sometimes unavoidable. As a
general rule, the more an extension exposes how GCC works internally,
the more likely it has been to need significant changes over time.
(asms being the easiest example to cite).
So please consider keeping something which signals the semantics might
The quote in question is:
Eventually there may be a way of asking the compiler to choose a
register automatically, but first we need to figure out how it should
choose and how to enable you to guide the choice. No solution is evident.
I struggle (and fail) to find anything in this text worth keeping.
So for the example, "a5" is a particularly bad choice these days on
the m68k as it's the PIC register. It may be advisable to just use
r<N> for some value of N and try to be processor agnostic here.
"a5" is what the original text used, but I have no preference. I've
changed it to r12, which works on my x64.