[llvm-commits] [llvm-gcc-4.2] r98728 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Stuart Hastings stuart at apple.com
Wed Mar 17 11:03:10 PDT 2010


On Mar 17, 2010, at 9:30 AM, Duncan Sands wrote:

> Hi Stuart,
> 
>> Use GCC-specd type when referencing ObjC2 bitfields.  Radar 7639995.
> 
> I never understood why llvm-gcc insists on using the "declared type" and
> not the gcc layed out bitfield types, which are much more logical from
> a low-level point of view.

I honestly don't know (you might ask Chris), but I'll speculate:

If I reference two one-bit bitfields that lie within one word in memory, but more than one byte apart, then the llvm-gcc habit of referencing both with word references could be plausibly coalesced into one memory reference.  But that's just a guess; I haven't constructed a test case to see if that actually happens, and it's not a very high priority right now.

FWIW, the bug here was an ObjC2 program that referenced memory outside of the struct.  It's clearly illegal, but usually harmless; this time, the Apple "guard malloc" library caught us.  :-)

stuart



More information about the llvm-commits mailing list