summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2004-05-04 16:14:32 +0000
committermiod <miod@openbsd.org>2004-05-04 16:14:32 +0000
commit3ec3567666e66e793ab0d2ddf9eade3aa5392628 (patch)
tree967e6c80e12e3d6cd3ab8137a8a4ecb969d7d1f8
parentIn _longjmp(), flush windows rather than attempting to backtrack manually, (diff)
downloadwireguard-openbsd-3ec3567666e66e793ab0d2ddf9eade3aa5392628.tar.xz
wireguard-openbsd-3ec3567666e66e793ab0d2ddf9eade3aa5392628.zip
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.
-rw-r--r--gnu/egcs/gcc/caller-save.c9
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)