AW: ARMv7: VLDR instruction for unaligned address (GCC 9.5.0)

Christian Gudrian CGU@ivu.de
Thu Jan 9 08:37:45 GMT 2025


Florian Weimer wrote:

> I don't think the C++ type system models non-natural alignment for references.

Declaring the struct __attribute__((packed)) yields the error "cannot bind packed field 'data.Data::id' to 'long long unsigned int&'" which fits your explanation. However, declaring it __attribute__((aligned(1))) compiles (but still fails at runtime). Shouldn't the compiler complain about misaligned references at the call site?

Christian



More information about the Gcc-help mailing list