https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118880
--- Comment #3 from Uwe Lohmann <ul...@t-online.de> --- Example attached. Compilation with: avr-gcc -Os -fwhole-program -mrelax -Wall -Wextra -mmcu=attiny861 -DF_CPU=1000000 main.c -o main.elf Interestingly, if the variable 'overflowState' in the attached example is removed, the bug does not occur.