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 2/3
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: David Wohlferd <dw at LimeGreenSocks dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Sandra Loosemore <sandra at codesourcery dot com>
- Date: Wed, 21 Oct 2015 06:27:55 -0500
- 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> <20151019214241 dot GQ17756 at gate dot crashing dot org> <56271390 dot 1000005 at LimeGreenSocks dot com>
On Tue, Oct 20, 2015 at 09:24:48PM -0700, David Wohlferd wrote:
> >>+Registers can be a limited resource on some systems and allowing the
> >They are a limited resource on almost all systems. "Scarce resource"?
>
> "Scarce" it is. I've left the rest alone for the moment, but how would
> you feel about:
>
> "Registers are a scarce resource on most systems and allowing the"
That sounds fine.
> >>+All global register variable declarations must precede all function
> >>+definitions. If such a declaration appears after function definitions,
> >>+the declaration would be too late to prevent the register from being used
> >>+for other purposes in the preceding functions.
> >This isn't true anymore, not even with -fno-toplevel-reorder or -O0.
>
> I'm going to interpret this as a recommendation to remove this text,
> rather than just an FYI. Done.
Perfect.
> >>+When selecting a register, choose one that is normally saved and
> >>+restored by function calls on your machine. This ensures that code
> >>+which is unaware of this reservation (such as library routines) will
> >>+restore it before returning.
> >The compiler also warns, possibly for the unlikely case that the user has
> >not read the documentation.
>
> I'm going to interpret this comment as just an FYI, and NOT something
> that should be added to the docs.
That is fine of course.
Cheers,
Segher