Hello all. I' using gcc version 4.3.2 (Ubuntu Jaunty) to compile some simple code. The makefile is one of these standard AVR makefile. The optimization is set to -Os (size).
For some historic reasons, I use the following macros: #ifndef BV #define BV(bit) (1<<(bit)) #endif #ifndef cbi #define cbi(reg,bit) reg &= ~(BV(bit)) #endif #ifndef sbi #define sbi(reg,bit) reg |= (BV(bit)) #endif So far so good. In my current sandbox project, I've tried to mark the occurrence of an interrupt by setting an "debug pin" high. For now, the ISR is empty. ISR(TIMER2_COMP_vect) { sbi(PORTC,6); // ... cbi(PORTC,6); } With -Os enables, the setup of the port pin is removed! Without optimization the pin toggles as expected. Why does the compiles removes the pin access code? It shouldn't do this, because the SFR pointer are declared volatile. Aren't they? What's my fault? -- Email: Joerg Desch <jd DOT vvd AT web DOT de> _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list