From b29514ee9d0889f3bf368d03db290d36f05f9922 Mon Sep 17 00:00:00 2001 From: "J\"orn Rennecke" Date: Thu, 24 Sep 1998 13:58:43 +0000 Subject: [PATCH] reload1.c (choose_reload_regs): Also try inheritance when reload_in is a stack slot of a pseudo... * reload1.c (choose_reload_regs): Also try inheritance when reload_in is a stack slot of a pseudo, even if we already got a reload reg. From-SVN: r22571 --- gcc/ChangeLog | 6 ++++++ gcc/reload1.c | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c46263833594..0b9d673dc94b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Thu Sep 24 21:48:51 1998 J"orn Rennecke + + * reload1.c (choose_reload_regs): Also try inheritance when + reload_in is a stack slot of a pseudo, even if we already got a + reload reg. + Thu Sep 24 21:22:39 1998 J"orn Rennecke * reload1.c (reload_cse_regs_1): Renamed from reload_cse_regs. diff --git a/gcc/reload1.c b/gcc/reload1.c index 91b7294a6ff8..bb7aa3fcfd80 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -5675,13 +5675,16 @@ choose_reload_regs (insn, avoid_return_reg) && ! reload_secondary_p[r]) continue; - /* If find_reloads chose a to use reload_in or reload_out as a reload + /* If find_reloads chose to use reload_in or reload_out as a reload register, we don't need to chose one. Otherwise, try even if it found one since we might save an insn if we find the value lying - around. */ + around. + Try also when reload_in is a pseudo without a hard reg. */ if (reload_in[r] != 0 && reload_reg_rtx[r] != 0 && (rtx_equal_p (reload_in[r], reload_reg_rtx[r]) - || rtx_equal_p (reload_out[r], reload_reg_rtx[r]))) + || (rtx_equal_p (reload_out[r], reload_reg_rtx[r]) + && GET_CODE (reload_in[r]) != MEM + && true_regnum (reload_in[r]) < FIRST_PSEUDO_REGISTER))) continue; #if 0 /* No longer needed for correct operation. @@ -5827,7 +5830,13 @@ choose_reload_regs (insn, avoid_return_reg) /* Don't really use the inherited spill reg if we need it wider than we've got it. */ || (GET_MODE_SIZE (reload_mode[r]) - > GET_MODE_SIZE (mode))) + > GET_MODE_SIZE (mode)) + /* If find_reloads chose reload_out as reload + register, stay with it - that leaves the + inherited register for subsequent reloads. */ + || (reload_reg_rtx + && rtx_equal_p (reload_out[r], + reload_reg_rtx[r]))) reload_override_in[r] = reg_last_reload_reg[regno]; else {