From 1ab3e58a2fddcddbd142fa5734289de4d83a85b1 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Fri, 12 Apr 2002 11:31:25 +0000 Subject: [PATCH] function.c (fixup_var_refs_1): For paradoxical (subreg VAR), replace VAR, don't try the subreg. * function.c (fixup_var_refs_1) : For paradoxical (subreg VAR), replace VAR, don't try the subreg. From-SVN: r52217 --- gcc/ChangeLog | 5 +++++ gcc/function.c | 30 ++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b62485ac028..f77367902b6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-04-12 Hans-Peter Nilsson + + * function.c (fixup_var_refs_1) : + For paradoxical (subreg VAR), replace VAR, don't try the subreg. + Fri Apr 12 10:51:38 2002 J"orn Rennecke * sh.c (broken_move): Constant 0. / 1. load is OK if there is diff --git a/gcc/function.c b/gcc/function.c index 5922712b8ed..86a87ab6068 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; -- 2.30.2