Re: AW: basic asm and memory clobbers - Proposed solution

2015-12-18 Thread David Wohlferd
On 12/17/2015 11:30 AM, Bernd Edlinger wrote: On Thu, 17 Dec 2015 15:13:07, Bernd Schmidt wrote: What's your take on making -Wonly-top-basic-asm a default (either now or v7)? Is making it a non-default a waste of time because no one will ever see it? Or is making it a default too aggr

AW: basic asm and memory clobbers - Proposed solution

2015-12-17 Thread Bernd Edlinger
Hi, On Thu, 17 Dec 2015 15:13:07, Bernd Schmidt wrote: > > What's your take on making -Wonly-top-basic-asm a default (either now or > > v7)? Is making it a non-default a waste of time because no one will > > ever see it? Or is making it a default too aggressive? What about > > adding it

AW: basic asm and memory clobbers - Proposed solution

2015-12-16 Thread Bernd Edlinger
Hi, On 15. Dezember 2015 23:43, Joseph Myers wrote: > I think the typical use of basic asm is: you want to manipulate I/O > registers or other such state unknown to the compiler (not any registers > the compiler might use itself), and you want to do it in a way that is > maximally compatible with

AW: basic asm and memory clobbers - Proposed solution

2015-12-15 Thread Bernd Edlinger
Hi, On 12/15/2015 13:52, Bernd Schmidt wrote: > > On 12/14/2015 09:10 AM, Segher Boessenkool wrote: > > That, and adding a memory clobber degrades performance for a lot of > > existing basic asm that does not expect the clobber, e.g. asm(""), > > asm("#"), asm("nop"), ... > > I wonder about this

Re: AW: basic asm and memory clobbers - Proposed solution

2015-12-02 Thread David Wohlferd
On 12/2/2015 3:34 AM, Bernd Edlinger wrote: Hi, Surely in code like that, you would make "x" volatile? Memory clobbers are not a substitute for correct use of volatile accesses. No, It is as I wrote, a memory clobber is the only way to guarantee that the asm statement is not move somewhere e

Re: AW: basic asm and memory clobbers - Proposed solution

2015-12-02 Thread David Brown
On 02/12/15 12:34, Bernd Edlinger wrote: > Hi, > >> Surely in code like that, you would make "x" volatile? Memory clobbers >> are not a substitute for correct use of volatile accesses. > > No, > > It is as I wrote, a memory clobber is the only way to guarantee that > the asm statement is not mo

Re: AW: basic asm and memory clobbers - Proposed solution

2015-12-02 Thread Bernd Edlinger
Hi, > Surely in code like that, you would make "x" volatile? Memory clobbers > are not a substitute for correct use of volatile accesses. No, It is as I wrote, a memory clobber is the only way to guarantee that the asm statement is not move somewhere else. I changed the example to use volatile

Re: AW: basic asm and memory clobbers - Proposed solution

2015-12-02 Thread David Brown
On 02/12/15 08:51, Bernd Edlinger wrote: > On 1.12.2015, David Wohlferd wrote: > On 12/1/2015 10:10 AM, Bernd Edlinger wrote: >>> But IMHO asm("bla":) isn't any better than asm("bla"). >>> I think _any_ asm with non-empty assembler string, that >>> claims to clobber _nothing_ is highly suspicious,

AW: basic asm and memory clobbers - Proposed solution

2015-12-01 Thread Bernd Edlinger
On 1.12.2015, David Wohlferd wrote: On 12/1/2015 10:10 AM, Bernd Edlinger wrote: > > But IMHO asm("bla":) isn't any better than asm("bla"). > > I think _any_ asm with non-empty assembler string, that > > claims to clobber _nothing_ is highly suspicious, and worth to be > > warned about. I don't se

Re: AW: basic asm and memory clobbers - Proposed solution

2015-11-27 Thread David Wohlferd
On 11/27/2015 11:02 PM, Bernd Edlinger wrote: Hi, I just found this in the docs: The compiler copies the assembler instructions in a basic @code{asm} verbatim to the assembly language output file, without processing dialects or any of the @samp{%} operators that are available with extended @co

AW: basic asm and memory clobbers - Proposed solution

2015-11-27 Thread Bernd Edlinger
Hi, I just found this in the docs: The compiler copies the assembler instructions in a basic @code{asm} verbatim to the assembly language output file, without processing dialects or any of the @samp{%} operators that are available with extended @code{asm}. This results in minor differences betwe

AW: basic asm and memory clobbers - Proposed solution

2015-11-27 Thread Bernd Edlinger
Hi, I just found this in the docs: The compiler copies the assembler instructions in a basic @code{asm} verbatim to the assembly language output file, without processing dialects or any of the @samp{%} operators that are available with extended @code{asm}. This results in minor differences betwe