This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposed doc update for Explicit Reg Vars 3/3


On 10/20/2015 03:29 AM, Segher Boessenkool wrote:
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.
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.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]