diff options
author | rearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-14 16:25:09 +0000 |
---|---|---|
committer | rearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-14 16:25:09 +0000 |
commit | b1c00d4097542d867e367954bd6f60da2bc87ebd (patch) | |
tree | cfe0e511c5773b158e11452df022ec23938aee59 /gcc/regrename.c | |
parent | bcbf7cf4d133ace3acffdc3c5ed3455445e8b301 (diff) | |
download | gcc-b1c00d4097542d867e367954bd6f60da2bc87ebd.tar.gz |
* regrename.c (find_oldest_value_reg): If the replacement uses
multiple hard registers, check that all of them are in CLASS.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75867 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regrename.c')
-rw-r--r-- | gcc/regrename.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/regrename.c b/gcc/regrename.c index 56f6a8842b6..871507b28f0 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -1,5 +1,5 @@ /* Register renaming for the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -1339,15 +1339,19 @@ find_oldest_value_reg (enum reg_class class, rtx reg, struct value_data *vd) { enum machine_mode oldmode = vd->e[i].mode; rtx new; + unsigned int last; - if (TEST_HARD_REG_BIT (reg_class_contents[class], i) - && (new = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i, - regno))) - { - ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg); - REG_ATTRS (new) = REG_ATTRS (reg); - return new; - } + for (last = i; last < i + HARD_REGNO_NREGS (i, mode); last++) + if (!TEST_HARD_REG_BIT (reg_class_contents[class], last)) + return NULL_RTX; + + if (new = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i, + regno)) + { + ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg); + REG_ATTRS (new) = REG_ATTRS (reg); + return new; + } } return NULL_RTX; |