Re: [avr-gcc-list] avr-g++ local variable constructor / block body / destructor execution order

2007-09-06 Thread David Brown
Oleksandr Redchuk wrote: 2007/9/2, David Brown [EMAIL PROTECTED]: Similarly, if you have multiple objects being constructed or destructed, their ordering is *not* guaranteed by the compiler AFAIR, this order guaranteed for objects in block of code and for objects in file - in order of

Re: [avr-gcc-list] avr-g++ local variable constructor / block body/ destructor execution order

2007-09-06 Thread Graham Davies
David Brown wrote: I believe [the compiler] can [change order of ... volatile objects access]. Obviously it is only legal if such moves do not affect the volatile accesses themselves. Perhaps someone here who has a better knowledge of the standards ... I wouldn't claim better knowledge, but

Re: [avr-gcc-list] avr-g++ local variable constructor / block body / destructor execution order

2007-09-05 Thread Oleksandr Redchuk
2007/9/2, David Brown [EMAIL PROTECTED]: Similarly, if you have multiple objects being constructed or destructed, their ordering is *not* guaranteed by the compiler AFAIR, this order guaranteed for objects in block of code and for objects in file - in order of definitions, but not guaranteed

Re: [avr-gcc-list] avr-g++ local variable constructor / block body / destructor execution order

2007-09-02 Thread David Brown
Oleksandr Redchuk wrote: Is this overoptimization bug or not? I'm not really an expert in this, but I think it is a valid optimisation. Access to SREG is volatile, so the compiler cannot change or re-order accesses, but it is free to re-arrange access to other (non-volatile) data around

Re: [avr-gcc-list] avr-g++ local variable constructor / block body / destructor execution order

2007-08-31 Thread Andy Parkins
On Friday 2007 August 31, Oleksandr Redchuk wrote: volatile uint32_t counter; gcc 4.x produces expected code, but, I think, volatile is not required in this code. I'm not sure; I think volatile is exactly what's needed, otherwise gcc is allowed to assume that the value won't change apart