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: 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:12:42 -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> <5625CDB6 dot 7030804 at redhat dot com>
On Mon, Oct 19, 2015 at 11:14:30PM -0600, Jeff Law wrote:
> >>+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've asked David to verify this. However, if you have, then he doesn't
> need to re-confirm.
- - -
int f(int a, int b) { int t = a + b; return t*t + a + b; }
register int nope asm("9");
- - -
on PowerPC (GPR9 is the first one allocated, adjust for other archs).
Segher