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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to