What alignment is needed on 8-bit AVR?

Viewed 993

I would have expected the 8-bit AVR platform to not require any alignment. However, I've found the following comment in an LLVM commit:

The previous data layout caused issues when dealing with atomics.

For example, it is illegal to load a 16-bit value with less than 16-bits of alignment.

This changes the data layout so that all types are aligned by at least their own width.

Unfortunately, the original author of this commit isn't sure if that is right either:

Most of the alignment stuff has been untouched since I originally imported the old SVN repository from SourceForge. I haven't dealt with it much and so my knowledge is pretty poor.

Safest to assume that if something looks intentional, it probably isn't ;P

What exactly is the alignment story on (8-bit) AVR?

1 Answers
Related