Request for discussion: Rewrite of inline assembler docs

shmeel gutl shmeelgutl@shmuelhome.mine.nu
Fri Mar 28 11:16:00 GMT 2014


On 28-Mar-14 01:46 PM, Hannes Frederic Sowa wrote:
> On Fri, Mar 28, 2014 at 09:41:41AM +0000, Andrew Haley wrote:
> Ok, I see the problem. Maybe something like this by avoiding the term? 
> Using this clobber causes the compiler to flush all (modified) 
> registers being used to store values which gcc decided to originally 
> allocate in memory before executing the @code{asm} statement.
>> 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.
> One would have to go into detail of various optimizations which could
> remove the address taking e.g. IMHO the last sentence of the paragraph already
> deals with this.
>
> Bye,
>
>    Hannes
>
By this wording (gcc decided), the consequences are unpredictable. You 
should probably mention the registers which will definitely be flushed 
and thereby limit the ambiguity.



More information about the Gcc mailing list