On 03/28/2014 09:30 AM, Hannes Frederic Sowa wrote:
> On Fri, Mar 28, 2014 at 09:10:11AM +0000, Andrew Haley wrote:
>> On 03/28/2014 06:20 AM, dw wrote:
>>> Using this clobber causes the compiler to flush all (modified) registers 
>>> being used to store memory-based values to memory before executing the 
>>> @code{asm} statement.
>>
>> I don't know what a "memory-based" value is.  This phrase doesn't help
>> at all.  In addition, it isn't true.  Modified registers are not
>> flushed to memory unless they are clobbered or their address is taken.
>> This sentence should be deleted.
> 
> i and sum form your example are not allocated in memory. If you make
> one of them static you should be able to see the effect.

I know.  That's not the point.  "memory-based" is not a well-defined
term.  In order to write clear documentation it is necessary either to
define terms or to use terms that are already well-defined.

What is true here is that all registers used to cache variables that
are reachable from pointers in the program are flushed.  Anything that
is statically allocated is reachable, as is anything dynamically
allocated by malloc; auto variables are not reachable unless their
address is taken.

Andrew.

Reply via email to