Hi,
I am getting this odd problem with structs. If the size of the struct
is larger than 4 bytes I can't access it.. It's most peculiar.
I have a test case (attached).
Build it with..
avr-gcc -O2 -fno-strict-aliasing -pipe -g -Wall -Wunreachable-code
-DF_CPU=16000000 -mmcu=atmega32 -Wa,-adhlmsn=testcase.lst -c testcase.c -o
testcase.o
avr-gcc -O2 -fno-strict-aliasing -pipe -g -Wall -Wunreachable-code -DF_CPU=16000000 -mmcu=atmega32 -Wl,-Map=testcase.map,--cref -g testcase.o -o testcase.elf
avr-objcopy -j .text -O ihex testcase.elf testcase.hex
avr-objdump -S testcase.elf > testcase.dmp
If BREAKME is defined all the struct accesses return 255 instead of what
they should be (I think :)
I am wondering if there is some oddity with GCC optimising for <= 4 byte
structs which unbreaks my code, but I can't see why it is broken.
Any help gratefully received!