This is the mail archive of the
mailing list for the GCC project.
Re: Proposed doc update for Explicit Reg Vars 3/3
- From: Jeff Law <law at redhat dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- 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 09:06:43 -0600
- 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> <20151020092917 dot GT17756 at gate dot crashing dot org>
On 10/20/2015 03:29 AM, Segher Boessenkool wrote:
Yup. That's more correct and certainly the message we want to give to
users. It's available in the asm. Beyond that, no guarantees whatsoever.
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
Say, the var is spilled to stack, so it is still live but not in any reg.