[llvm-dev] Alignment Member Functions should be Virtual

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu May 3 00:19:32 PDT 2018


On 3 May 2018 at 03:23, Hiroyuki Chishiro via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> However, aligned memory access instructions (such as 32-bit LW) are
> used in this case, and hence my compiler cannot correctly access char
> string written in C.

This hardware situation was reasonably common in the past, but code
still accessed objects not aligned to 32-bits. The compiler just had
to use multiple aligned loads to access data crossing a word boundary
and combine the data.

You'll probably find that path simpler than inventing a pathological C
dialect. As Eli said, changing getCharAlign is likely to have huge
knock-on consequences that the rest of Clang just isn't ready for.

Cheers.

Tim.


More information about the llvm-dev mailing list