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)
{
if (dst->target) {
if (dstSize > TargetBytesPerWord
and src->source->registerSize(c) > TargetBytesPerWord)
{
apply(c, Move, srcSelectSize, src->source, src->source,
dstSize, dst->target, dst->target);
if (live(c, dst) == 0) {
removeSite(c, dst, dst->target);
if (dstSize > TargetBytesPerWord) {
removeSite(c, dst->nextWord, dst->nextWord->target);
if (dstSize > TargetBytesPerWord) {
if (src->source->registerSize(c) > TargetBytesPerWord) {
apply(c, Move, srcSelectSize, src->source, src->source,
dstSize, dst->target, dst->target);
if (live(c, dst) == 0) {
removeSite(c, dst, dst->target);
if (dstSize > TargetBytesPerWord) {
removeSite(c, dst->nextWord, dst->nextWord->target);
}
}
}
} else {
maybeMove(c, Move, TargetBytesPerWord, TargetBytesPerWord, src,
TargetBytesPerWord, dst, dstLowMask);
if (dstSize > TargetBytesPerWord) {
} else {
src->nextWord->source->freeze(c, src->nextWord);
maybeMove(c, Move, TargetBytesPerWord, TargetBytesPerWord, src,
TargetBytesPerWord, dst, dstLowMask);
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);