[PATCH] D46042: Cap vector alignment at 16 for all Darwin platforms

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 3 11:41:37 PDT 2018


ahatanak added a comment.

> Note that this sort of attribute is stripped from template arguments in template substitution, so there's a possibility that code templated over vectors will produce inadequately-aligned objects.

I was wondering whether there is a warning clang issues when the aligned attribute is stripped. If it doesn't warn, should it? I recently came across a case where a 16-byte vector annotated with a 4-byte alignment was passed to std::swap, which caused a crash because the alignment was stripped and the x86 backend decided to emit an 16-byte aligned load to load an unaligned vector.


Repository:
  rC Clang

https://reviews.llvm.org/D46042





More information about the cfe-commits mailing list