fix bug which failed to preserve source site during multi-word move

The compiler was failing to freeze the source site containing the
value of the second word in a multi-word move, leading to mis-compiled
code in some cases.
This commit is contained in:
Joel Dice 2012-06-26 08:39:23 -06:00
parent ac16a1a2ad
commit cfd9dc6656

View File

@ -3773,9 +3773,8 @@ class MoveEvent: public Event {
and srcSelectSize >= dstSize)
{
if (dst->target) {
if (dstSize > TargetBytesPerWord
and src->source->registerSize(c) > TargetBytesPerWord)
{
if (dstSize > TargetBytesPerWord) {
if (src->source->registerSize(c) > TargetBytesPerWord) {
apply(c, Move, srcSelectSize, src->source, src->source,
dstSize, dst->target, dst->target);
@ -3786,13 +3785,20 @@ class MoveEvent: public Event {
}
}
} else {
src->nextWord->source->freeze(c, src->nextWord);
maybeMove(c, Move, TargetBytesPerWord, TargetBytesPerWord, src,
TargetBytesPerWord, dst, dstLowMask);
if (dstSize > TargetBytesPerWord) {
src->nextWord->source->thaw(c, src->nextWord);
maybeMove
(c, Move, TargetBytesPerWord, TargetBytesPerWord, src->nextWord,
TargetBytesPerWord, dst->nextWord, dstHighMask);
}
} else {
maybeMove(c, Move, TargetBytesPerWord, TargetBytesPerWord, src,
TargetBytesPerWord, dst, dstLowMask);
}
} else {
Site* low = pickSiteOrMove(c, src, dst, 0, 0);