Proposed doc update for Explicit Reg Vars 2/3

David Wohlferd dw@LimeGreenSocks.com
Wed Oct 21 04:25:00 GMT 2015


> Line too long. I know quite a bit of doc does that, but that's no 
> excuse :-)

Reduced to < 79.

>> +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"

>> +After defining a global register variable, for the duration of
>> +the current compilation:
> It's probably better to say "for the current compilation unit"?  There now
> is LTO and whatnot.

Changed to "for the current compilation unit".

>> +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.

>> +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.

I've attached the new patch for the Globals.  For review purposes, you 
can just diff it with the previous one.  Viewed that way, the changes 
are pretty minor.

dw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: exp2a.patch
Type: text/x-patch
Size: 9130 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20151021/b50212b3/attachment.bin>


More information about the Gcc mailing list