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,26 +3773,32 @@ class MoveEvent: public Event {
and srcSelectSize >= dstSize) and srcSelectSize >= dstSize)
{ {
if (dst->target) { if (dst->target) {
if (dstSize > TargetBytesPerWord if (dstSize > TargetBytesPerWord) {
and src->source->registerSize(c) > TargetBytesPerWord) if (src->source->registerSize(c) > TargetBytesPerWord) {
{ apply(c, Move, srcSelectSize, src->source, src->source,
apply(c, Move, srcSelectSize, src->source, src->source, dstSize, dst->target, dst->target);
dstSize, dst->target, dst->target);
if (live(c, dst) == 0) {
if (live(c, dst) == 0) { removeSite(c, dst, dst->target);
removeSite(c, dst, dst->target); if (dstSize > TargetBytesPerWord) {
if (dstSize > TargetBytesPerWord) { removeSite(c, dst->nextWord, dst->nextWord->target);
removeSite(c, dst->nextWord, dst->nextWord->target); }
} }
} } else {
} else { src->nextWord->source->freeze(c, src->nextWord);
maybeMove(c, Move, TargetBytesPerWord, TargetBytesPerWord, src,
TargetBytesPerWord, dst, dstLowMask); maybeMove(c, Move, TargetBytesPerWord, TargetBytesPerWord, src,
if (dstSize > TargetBytesPerWord) { TargetBytesPerWord, dst, dstLowMask);
src->nextWord->source->thaw(c, src->nextWord);
maybeMove maybeMove
(c, Move, TargetBytesPerWord, TargetBytesPerWord, src->nextWord, (c, Move, TargetBytesPerWord, TargetBytesPerWord, src->nextWord,
TargetBytesPerWord, dst->nextWord, dstHighMask); TargetBytesPerWord, dst->nextWord, dstHighMask);
} }
} else {
maybeMove(c, Move, TargetBytesPerWord, TargetBytesPerWord, src,
TargetBytesPerWord, dst, dstLowMask);
} }
} else { } else {
Site* low = pickSiteOrMove(c, src, dst, 0, 0); Site* low = pickSiteOrMove(c, src, dst, 0, 0);