[avr-libc-dev] [bug #14616] definition of sei() in interrupts.h is faulty

2005-10-01 Thread anonymous
Follow-up Comment #6, bug #14616 (project avr-libc): Joerg Wunsch wrote on Montag, 26. September 2005 21:04 : GCC's documentation says:  The `volatile' keyword indicates that the instruction has important side-effects.  GCC will not delete a volatile `asm' if it is reachable. (The

[avr-libc-dev] [bug #14616] definition of sei() in interrupts.h is faulty

2005-09-26 Thread anonymous
Follow-up Comment #5, bug #14616 (project avr-libc): The unfortunate thing is, that using volatile is not enough. Even if it works for your extremely simple test case: I am having a more complex test case example in my application code, where it does *not* work because gcc reorders the

Re: [avr-libc-dev] [bug #14616] definition of sei() in interrupts.h is faulty

2005-09-26 Thread Joerg Wunsch
As anonymous wrote: FYI: I had started with code like { uint8_t temp = SREG; asm volatile (cli : :); volatile_declared_uint16_t_var_in_memory = value; SREG = temp; } Here gcc had reordered it such that it would read { uint8_t temp = SREG; asm volatile (cli : :);

Re: [avr-libc-dev] [bug #14616] definition of sei() in interrupts.h is faulty

2005-09-26 Thread Joerg Wunsch
As Russell Shaw wrote: Linux code has rmb() and wmb() for read memory barrier and write memory barrier, to solve that reordering problem. Something might be learned from finding how those macros are defined. They end up in a spaghetti of header files, but if my brain can trace that right,

Re: [avr-libc-dev] [bug #14616] definition of sei() in interrupts.h is faulty

2005-09-26 Thread Björn Haase
Dmitry K. wrote on Dienstag, 27. September 2005 05:03 : On Tuesday 27 September 2005 01:54, Björn wrote: Follow-up Comment #5, bug #14616 (project avr-libc): The unfortunate thing is, that using volatile is not enough. Even if it works for your extremely simple test case: I am having a

[avr-libc-dev] [bug #14616] definition of sei() in interrupts.h is faulty

2005-09-23 Thread anonymous
Follow-up Comment #3, bug #14616 (project avr-libc): Dimitry wrote: May be, if necessary it is better to add 'volatile' in definition of a concrete variable, than to endow speed always? The problem is that declaring the variable to be volatile does not prevent the problem. The issue is that