diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-05-04 16:14:33 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-05-04 16:14:33 +0000 |
commit | e3cbd3093b4e97d16ef033e08969ef257db21a73 (patch) | |
tree | 5d8e865eadc77a5af1e4a10766dd0b09a3ef885c /gnu/egcs/gcc | |
parent | 6ad82160203c4fca197d07d09d81c1e625169875 (diff) |
Backport a fix from gcc 3 (revision 1.32):
* caller-save.c (mark_referenced_regs): Mark partially-overwritten
multi-word registers.
This problem apparently only affected m88k, as far as OpenBSD is concerned.
Diffstat (limited to 'gnu/egcs/gcc')
-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) |