On Wed, Mar 05, 2014 at 10:39:51AM +0400, Yury Gribov wrote:
> >What is volatile instructions? Can you give us an example?
>
> Check volatile_insn_p. AFAIK there are two classes of volatile instructions:
> * volatile asm
> * unspec volatiles (target-specific instructions for e.g. protecting
> func
On Mar 5, 2014, at 10:07 AM, Richard Henderson wrote:
> On 03/04/2014 10:12 PM, Yury Gribov wrote:
Asms without outputs are automatically volatile. So there ought be zero
change
with and without the explicit use of the __volatile__ keyword.
>>>
>>> That’s what the documentation
On 03/04/2014 10:12 PM, Yury Gribov wrote:
>>> Asms without outputs are automatically volatile. So there ought be zero
>>> change
>>> with and without the explicit use of the __volatile__ keyword.
>>
>> That’s what the documentation says but it wasn’t actually true
>> as of a couple of releases a
What is volatile instructions? Can you give us an example?
Check volatile_insn_p. AFAIK there are two classes of volatile instructions:
* volatile asm
* unspec volatiles (target-specific instructions for e.g. protecting
function prologues)
-Y
>> Asms without outputs are automatically volatile. So there ought be
zero change
>> with and without the explicit use of the __volatile__ keyword.
>
> That’s what the documentation says but it wasn’t actually true
> as of a couple of releases ago, as I recall.
Looks like 2005:
$ git annotate
On Mar 4, 2014, at 2:30 PM, Richard Henderson wrote:
> On 03/04/2014 01:23 AM, Richard Biener wrote:
>> Doesn't sound like a bug but a feature. We can move
>> asm ("" : : : "memory") around freely up to the next/previous
>> instruction involving memory.
>
> Asms without outputs are automatical
On 03/04/2014 01:23 AM, Richard Biener wrote:
> Doesn't sound like a bug but a feature. We can move
> asm ("" : : : "memory") around freely up to the next/previous
> instruction involving memory.
Asms without outputs are automatically volatile. So there ought be zero change
with and without the
On Tue, Mar 04, 2014 at 12:08:19PM +0100, Richard Biener wrote:
> On Tue, Mar 4, 2014 at 10:33 AM, Hannes Frederic Sowa
> wrote:
> > On Tue, Mar 04, 2014 at 09:26:31AM +, Andrew Haley wrote:
> >> On 03/04/2014 09:24 AM, Hannes Frederic Sowa wrote:
> >> >> > So the bug was probably fixed more t
On Tue, Mar 4, 2014 at 1:01 PM, Hans-Peter Nilsson wrote:
> On Tue, 4 Mar 2014, Yury Gribov wrote:
>> Richard wrote:
>> > volatile __asm__("":::"memory")
>> >
>> > is a memory barrier and a barrier for other volatile instructions.
>>
>> AFAIK asm without output arguments is implicitly marked as vo
On Tue, 4 Mar 2014, Yury Gribov wrote:
> Richard wrote:
> > volatile __asm__("":::"memory")
> >
> > is a memory barrier and a barrier for other volatile instructions.
>
> AFAIK asm without output arguments is implicitly marked as volatile. So it may
> not be needed in barrier() at all.
Yes, exactl
Richard wrote:
> volatile __asm__("":::"memory")
>
> is a memory barrier and a barrier for other volatile instructions.
AFAIK asm without output arguments is implicitly marked as volatile. So
it may not be needed in barrier() at all.
-Y
On Tue, Mar 04, 2014 at 12:08:19PM +0100, Richard Biener wrote:
> On Tue, Mar 4, 2014 at 10:33 AM, Hannes Frederic Sowa
> wrote:
> > On Tue, Mar 04, 2014 at 09:26:31AM +, Andrew Haley wrote:
> >> On 03/04/2014 09:24 AM, Hannes Frederic Sowa wrote:
> >> >> > So the bug was probably fixed more t
On Tue, Mar 4, 2014 at 10:33 AM, Hannes Frederic Sowa
wrote:
> On Tue, Mar 04, 2014 at 09:26:31AM +, Andrew Haley wrote:
>> On 03/04/2014 09:24 AM, Hannes Frederic Sowa wrote:
>> >> > So the bug was probably fixed more than 15 years ago.
>> > Probably :)
>> >
>> > But the __volatile__ shoud do
On Tue, Mar 04, 2014 at 09:26:31AM +, Andrew Haley wrote:
> On 03/04/2014 09:24 AM, Hannes Frederic Sowa wrote:
> >> > So the bug was probably fixed more than 15 years ago.
> > Probably :)
> >
> > But the __volatile__ shoud do no harm and shouldn't influence code
> > generation in any way, no?
On 03/04/2014 09:24 AM, Hannes Frederic Sowa wrote:
>> > So the bug was probably fixed more than 15 years ago.
> Probably :)
>
> But the __volatile__ shoud do no harm and shouldn't influence code
> generation in any way, no?
Of course it will: it's a barrier.
Andrew.
On Tue, Mar 04, 2014 at 09:19:40AM +, Jonathan Wakely wrote:
> On 4 March 2014 09:17, Hannes Frederic Sowa
> wrote:
> > On Tue, Mar 04, 2014 at 10:10:21AM +0100, Richard Biener wrote:
> >> On Tue, Mar 4, 2014 at 7:40 AM, lin zuojian wrote:
> >> > Hi,
> >> > in include/linux/compiler-gcc.
On Tue, Mar 4, 2014 at 10:19 AM, Jonathan Wakely wrote:
> On 4 March 2014 09:17, Hannes Frederic Sowa
> wrote:
>> On Tue, Mar 04, 2014 at 10:10:21AM +0100, Richard Biener wrote:
>>> On Tue, Mar 4, 2014 at 7:40 AM, lin zuojian wrote:
>>> > Hi,
>>> > in include/linux/compiler-gcc.h :
>>> >
>>
On 4 March 2014 09:17, Hannes Frederic Sowa wrote:
> On Tue, Mar 04, 2014 at 10:10:21AM +0100, Richard Biener wrote:
>> On Tue, Mar 4, 2014 at 7:40 AM, lin zuojian wrote:
>> > Hi,
>> > in include/linux/compiler-gcc.h :
>> >
>> > /* Optimization barrier */
>> > /* The "volatile" is due to gcc
On Tue, Mar 04, 2014 at 10:10:21AM +0100, Richard Biener wrote:
> On Tue, Mar 4, 2014 at 7:40 AM, lin zuojian wrote:
> > Hi,
> > in include/linux/compiler-gcc.h :
> >
> > /* Optimization barrier */
> > /* The "volatile" is due to gcc bugs */
> > #define barrier() __asm__ __volatile__("": : :"m
On Tue, Mar 4, 2014 at 7:40 AM, lin zuojian wrote:
> Hi,
> in include/linux/compiler-gcc.h :
>
> /* Optimization barrier */
> /* The "volatile" is due to gcc bugs */
> #define barrier() __asm__ __volatile__("": : :"memory")
>
> The comment of Linux says this is a gcc bug.But will any sane comp
Hi,
in include/linux/compiler-gcc.h :
/* Optimization barrier */
/* The "volatile" is due to gcc bugs */
#define barrier() __asm__ __volatile__("": : :"memory")
The comment of Linux says this is a gcc bug.But will any sane compiler
disable optimization without "volatile" key word?
--
Reg
21 matches
Mail list logo