Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-09-09 Thread Yiran Wang via cfe-commits
yiranwang added a comment. Thank you, Eric. Also, could you please help to commit the change? I personally do not have the permissions to change libc++ code, thanks a lot. http://reviews.llvm.org/D12247 ___ cfe-commits mailing list cfe-commits@list

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-09-01 Thread Yiran Wang via cfe-commits
yiranwang added a comment. Thanks for testing. There is proof as the following, given that alignment of _Aligner is _Align (the whole purpose of _Aligner here, which we do not want to double check), and for any type, the "sizeof" is always multiple of "alignof", this change should be ABI compat

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-27 Thread Yiran Wang via cfe-commits
yiranwang added a comment. In http://reviews.llvm.org/D12247#234533, @EricWF wrote: > So this patch LGTM. Sorry for being slow to understand it. However I want to > see two things before it lands. > > 1. I would like to see a test of some sort that the resulting type has the > same size and ali

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-26 Thread Yiran Wang via cfe-commits
yiranwang added a comment. Hi Eric, Could you please explain a bit more what is broken specifically? As we can see, sizeof(), _Len, and _Align, and alignof() of "aligned_storage" are all not changed. http://reviews.llvm.org/D12247 ___ cfe-commits

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-26 Thread Yiran Wang via cfe-commits
yiranwang added a comment. some more explanation of last comment. For most architecture sizeof(function) is 4*sizeof(void *), but it is 6*sizeof(void*) on AARCH64/LINUX, which does not sound so great as there are padding of 2*sizeof(void*) bytes. http://reviews.llvm.org/D12247 _

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-26 Thread Yiran Wang via cfe-commits
yiranwang added a comment. In http://reviews.llvm.org/D12247#233349, @EricWF wrote: > In http://reviews.llvm.org/D12247#233323, @davidxl wrote: > > > We certainly need a fix without breaking ABI. Is there a ABI conformance > > test for libcxx? > > > Well this patch definitely breaks the ABI. Thi

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-24 Thread Yiran Wang via cfe-commits
yiranwang added a comment. A test case is as following. It has to be build by GCC 4.9 -O3 (maybe or later), with latest libc++, and for AARCH64+ANDROID target. AARCH64 requires 128 bit alignment for aligned_storage and 64 bit pointers, while gcc 4.9 alias analysis will do field-sensitive points

[PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-21 Thread Yiran Wang via cfe-commits
yiranwang created this revision. yiranwang added a subscriber: cfe-commits. In libc++, there are some usage of aligned_storage which uses "sizeof" bytes of raw data. This is problematic a bit, as the trailing padding area will be counted by "sizeof", and it leads to out of bound access. For exam