[LLVMdev] Language lawyer question
Brian Hurt
bhurt at spnz.org
Wed Mar 12 18:03:08 PDT 2008
On Wed, 12 Mar 2008, Shantonu Sen wrote:
> 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.
You're assuming the structure you're copying both from and to exist in
memory. What happens if the compiler decided to place one of them in
registers, such that a structure like:
struct example {
short x;
double y;
}
is stored in two registers, with no padding?
Brian
More information about the llvm-dev
mailing list