diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2002-04-12 11:31:25 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2002-04-12 11:31:25 +0000 |
commit | 1ab3e58a2fddcddbd142fa5734289de4d83a85b1 (patch) | |
tree | 94fd28ef6a94bc51e738df04396dbe699907efb0 /gcc/function.c | |
parent | 4b72e8edacabbf47b7ec8035bbe87d4aaf5dca9a (diff) | |
download | gcc-1ab3e58a2fddcddbd142fa5734289de4d83a85b1.zip gcc-1ab3e58a2fddcddbd142fa5734289de4d83a85b1.tar.gz gcc-1ab3e58a2fddcddbd142fa5734289de4d83a85b1.tar.bz2 |
function.c (fixup_var_refs_1): For paradoxical (subreg VAR), replace VAR, don't try the subreg.
* function.c (fixup_var_refs_1) <SET, handling VAR in SET_SRC>:
For paradoxical (subreg VAR), replace VAR, don't try the subreg.
From-SVN: r52217
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/gcc/function.c b/gcc/function.c index 5922712..86a87ab 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2370,15 +2370,29 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements, no_share) { rtx pat, last; - replacement = find_fixup_replacement (replacements, SET_SRC (x)); - if (replacement->new) - SET_SRC (x) = replacement->new; - else if (GET_CODE (SET_SRC (x)) == SUBREG) - SET_SRC (x) = replacement->new - = fixup_memory_subreg (SET_SRC (x), insn, 0); + if (GET_CODE (SET_SRC (x)) == SUBREG + && (GET_MODE_SIZE (GET_MODE (SET_SRC (x))) + > GET_MODE_SIZE (GET_MODE (var)))) + { + /* This (subreg VAR) is now a paradoxical subreg. We need + to replace VAR instead of the subreg. */ + replacement = find_fixup_replacement (replacements, var); + if (replacement->new == NULL_RTX) + replacement->new = gen_reg_rtx (GET_MODE (var)); + SUBREG_REG (SET_SRC (x)) = replacement->new; + } else - SET_SRC (x) = replacement->new - = fixup_stack_1 (SET_SRC (x), insn); + { + replacement = find_fixup_replacement (replacements, SET_SRC (x)); + if (replacement->new) + SET_SRC (x) = replacement->new; + else if (GET_CODE (SET_SRC (x)) == SUBREG) + SET_SRC (x) = replacement->new + = fixup_memory_subreg (SET_SRC (x), insn, 0); + else + SET_SRC (x) = replacement->new + = fixup_stack_1 (SET_SRC (x), insn); + } if (recog_memoized (insn) >= 0) return; |