[llvm-commits] [126488] Fix PR1352 and CFrontend/2007-04-24-VolatileStructCopy.c
Chris Lattner
clattner at apple.com
Thu Apr 26 17:49:36 PDT 2007
On Apr 24, 2007, at 11:48 PM, Duncan Sands wrote:
> Hi Chris,
>
>> // Non-bitfield aggregate value.
>> - Emit(TREE_OPERAND(exp, 1), LV.Ptr);
>> - if (DestLoc)
>> + if (DestLoc) {
>> + Emit(TREE_OPERAND(exp, 1), LV.Ptr);
>> EmitAggregateCopy(DestLoc, LV.Ptr, TREE_TYPE(exp),
>> isVolatile, false);
>
> why is this ^^^ right?
Possibly not, I was trying to preserve current behavior, because I
don't have a testcase.
> Doesn't a non-null DestLoc mean you are doing something
> like: A = (B = C), where DestLoc represents A, and the current
> MODIFY_EXPR
> represents B=C?
Yes, something like that.
> If so, then the above is bogus: isVolatile says whether writes
> to B are volatile, not writes to A: if isVolatile is true, then you
> are doing
> a volatile write to A, which may or may not need it, and a non-
> volatile write
> to B when a volatile write is needed!
Right,
-Chris
More information about the llvm-commits
mailing list