[llvm-commits] [llvm-gcc-4.2] r100632 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Chris Lattner clattner at apple.com
Wed Apr 7 11:13:07 PDT 2010


On Apr 7, 2010, at 10:02 AM, Duncan Sands wrote:
> this means that you can't write S.d and S.e separately, so if one thread is
> writing to S.d while another writes to S.e then you are in trouble.  Also, if
> this type is describing a memory mapped I/O region then writing or reading both
> d and e when the original code only touches one of them is bad.  I appreciate
> that the C standard doesn't require this kind of thing to work, but I'm pretty
> sure the Ada standard does [*].  (That said, what llvm-gcc did before was
> already broken for Ada, due to this kind of thing).
> 
> I would much rather see reads and writes touch as little as possible, and
> have the optimizers combine them if they can prove that it is safe.

Bitfields in C and C++ (even in C++'0x with the new memory model) don't require this.  It is much much better for performance to do what Jakob is doing, and GCC already does it.  I don't know anything about the Ada case though.

-Chris



More information about the llvm-commits mailing list