Hi, I'm not sure if this is the correct forum, but I'm not sure whether this is a bug, or a feature. Im working on a program for an AVR microcontroller using avr-gcc for the compilation. $ avr-gcc -v Using built-in specs. COLLECT_GCC=avr-gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/4.8.2/lto-wrapper Target: avr Configured with: /build/avr-gcc/src/gcc-4.8.2/configure --disable-cloog-version-check --disable-install-libiberty --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-linker-build-id --disable-nls --disable-werror --enable-__cxa_atexit --enable-checking=release --enable-clocale=gnu --enable-cloog-backend=isl --enable-gnu-unique-object --enable-gold --enable-languages=c,c++ --enable-ld=default --enable-lto --enable-plugin --enable-shared --infodir=/usr/share/info --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --prefix=/usr --target=avr --with-as=/usr/bin/avr-as --with-gnu-as --with-gnu-ld --with-ld=/usr/bin/avr-ld --with-plugin-ld=ld.gold --with-system-zlib Thread model: single gcc version 4.8.2 (GCC) I have gotten an issue with a single function variable not being checked after optimization. My question is: shouldn't I be able to assume that function variables are treated as being volatile, unless optimized away completely? Marking the function variable volatile solves the issue. The code is compiled with -O2 -ffreestanding -Wall -Wextra and produces no warnings. I have not been able to create a simple test-case, but I can supply the entire source upon request. Best regards, Henrik Juul Pedersen LIAB ApS