This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Proposed doc update for Explicit Reg Vars 3/3
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: David Wohlferd <dw at LimeGreenSocks dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Sandra Loosemore <sandra at codesourcery dot com>
- Date: Tue, 20 Oct 2015 04:29:17 -0500
- Subject: Re: Proposed doc update for Explicit Reg Vars 3/3
- Authentication-results: sourceware.org; auth=none
- References: <561C3DAE dot 8050505 at LimeGreenSocks dot com> <20151019215522 dot GR17756 at gate dot crashing dot org> <5625D047 dot 903 at redhat dot com>
On Mon, Oct 19, 2015 at 11:25:27PM -0600, Jeff Law wrote:
> >>+Defining a register variable does not reserve the register; it
> >>+remains available for other uses in places where flow control determines
> >>+the variable's value is not live. For this reason, the following uses
> >
> >This is misleading -- people will try to keep the variable "live" so it
> >stays in the wanted reg. Which is not something guaranteed to work either.
> I think some of the confusion here is that paragraph is just hard to
> parse. To some degree this is inevitable because you have to think like
> a compiler junkie. Perhaps something like this.
>
>
> Defining a register variable does not reserve the register. The
> register remains available to hold unrelated values in places where the
> variable is not live according to dataflow analysis.
It "remains available" *anywhere* except in the asms where it is an
operand. So the statement does not say anything. First line is fine of
course.
Say, the var is spilled to stack, so it is still live but not in any reg.
Segher