[LLVMdev] Language lawyer question
dalej at apple.com
Wed Mar 12 07:37:58 PDT 2008
On Mar 12, 2008, at 12:23 AM, Shantonu Sen wrote:
> On Mar 11, 2008, at 10:52 PM, Dale Johannesen wrote:
>>> I think the test case is bogus in terms of language correctness,
> My gut. I listen to my gut. More seriously, C99 section 220.127.116.11
> paragraph 6 has:
>> When a value is stored in an object of structure or union type,
>> including in a member
>> object, the bytes of the object representation that correspond to
>> anypadding bytes take
>> unspeciﬁed values.42)
> and the footnote says:
>> 42) Thus, for example, structure assignment need not copyany
>> padding bits.
Ah, thanks. I thought that was probably the intent but couldn't find
it. That is definitive.
> I think that covers this case for at least C99. The test case should
> not assume the padding bytes are copied.
> If you assume "need not copy" semantics, the test case doesn't have
> much value for correctness. If you want LLVM to assume an
> implementation-specific "must copy" or "must not copy" behavior, you
> could tweak the test case as needed, I suppose. But under aggressive
> optimization, you rapidly approach "must copy" semantics, and then
> the question is why you don't do that for even the degenerate cases.
> So again, it turns into an optimization test case.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev