diff options
-rw-r--r-- | gnu/egcs/gcc/caller-save.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/egcs/gcc/caller-save.c b/gnu/egcs/gcc/caller-save.c index 7c390a5955e..4f18a231e88 100644 --- a/gnu/egcs/gcc/caller-save.c +++ b/gnu/egcs/gcc/caller-save.c @@ -504,7 +504,14 @@ mark_referenced_regs (x) x = SET_DEST (x); code = GET_CODE (x); if (code == REG || code == PC || code == CC0 - || (code == SUBREG && GET_CODE (SUBREG_REG (x)) == REG)) + || (code == SUBREG && GET_CODE (SUBREG_REG (x)) == REG + /* If we're setting only part of a multi-word register, + we shall mark it as referenced, because the words + that are not being set should be restored. */ + && ((GET_MODE_SIZE (GET_MODE (x)) + >= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) + || (GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))) + <= UNITS_PER_WORD)))) return; } if (code == MEM || code == SUBREG) |