[Bug target/100962] Poor optimization of AVR code when using structs in __flash

2021-06-08 Thread mojo at world3 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100962 --- Comment #3 from mojo at world3 dot net --- Apologies, I noticed I had -Og on. Tried with -O3 and it optimised the struct away. With -O2 it uses the Z register with displacement, reading data from flash. So it seems that only -Og produces poo

[Bug target/100962] Poor optimization of AVR code when using structs in __flash

2021-06-08 Thread mojo at world3 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100962 --- Comment #2 from mojo at world3 dot net --- avr-gcc-11.1.0-x64-windows>bin\avr-gcc -Og -xc -Wall -mmcu=atxmega64a1u test.c avr-gcc-11.1.0-x64-windows>bin\avr-objdump -h -S a.out > list.s Still producing code like this 2de: 18 97

[Bug c/100962] New: Poor optimization of AVR code when using structs in __flash

2021-06-08 Thread mojo at world3 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100962 Bug ID: 100962 Summary: Poor optimization of AVR code when using structs in __flash Product: gcc Version: 5.4.0 Status: UNCONFIRMED Severity: normal