From cecbf6e2b3fcef0f3bd4131d78775e65e5bdaf4a Mon Sep 17 00:00:00 2001 From: "J\"orn Rennecke" Date: Thu, 21 May 1998 11:52:31 +0000 Subject: [PATCH] reload1.c (reload_reg_free_for_value_p): Fix RELOAD_FOR_INPUT end of lifetime and RELOAD_FOR_OUTPUT start of lifetime. * reload1.c (reload_reg_free_for_value_p): Fix RELOAD_FOR_INPUT end of lifetime and RELOAD_FOR_OUTPUT start of lifetime. From-SVN: r19929 --- gcc/ChangeLog | 5 +++++ gcc/reload1.c | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 077c913a85b..1bca42dae8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Thu May 21 19:50:13 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_for_value_p): Fix RELOAD_FOR_INPUT + end of lifetime and RELOAD_FOR_OUTPUT start of lifetime. + Thu May 21 19:32:27 1998 J"orn Rennecke * combine.c (nonzero_bits): For paradoxical subregs, take diff --git a/gcc/reload1.c b/gcc/reload1.c index e3bc950c08f..e0602bed2ae 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -5003,7 +5003,14 @@ reload_reg_free_for_value_p (regno, opnum, type, value) monotonic. Some reload types use different 'buckets' for each operand. So there are MAX_RECOG_OPERANDS different time values for each - such reload type. */ + such reload type. + We compute TIME1 as the time when the register for the prospective + new reload ceases to be live, and TIME2 for each existing + reload as the time when that the reload register of that reload + becomes live. + Where there is little to be gained by exact lifetime calculations, + we just make conservative assumptions, i.e. a longer lifetime; + this is done in the 'default:' cases. */ switch (type) { case RELOAD_FOR_OTHER_ADDRESS: @@ -5022,10 +5029,12 @@ reload_reg_free_for_value_p (regno, opnum, type, value) time1 = opnum * 4 + 2; break; case RELOAD_FOR_INPUT: - time1 = opnum * 4 + 3; + /* All RELOAD_FOR_INPUT reloads remain live till just before the + instruction is executed. */ + time1 = (MAX_RECOG_OPERANDS - 1) * 4 + 3; break; /* opnum * 4 + 3 < opnum * 4 + 4 - <= (MAX_RECOG_OPERAND - 1) * 4 + 4 == MAX_RECOG_OPERAND * 4 */ + <= (MAX_RECOG_OPERANDS - 1) * 4 + 4 == MAX_RECOG_OPERANDS * 4 */ case RELOAD_FOR_OUTPUT_ADDRESS: time1 = MAX_RECOG_OPERANDS * 4 + opnum; break; @@ -5057,10 +5066,13 @@ reload_reg_free_for_value_p (regno, opnum, type, value) case RELOAD_FOR_INPUT: time2 = reload_opnum[i] * 4 + 3; break; - /* RELOAD_FOR_OUTPUT and RELOAD_FOR_OUTPUT_ADDRESS reloads - for identical operand number conflict with each other, so - assign them the same time value. */ case RELOAD_FOR_OUTPUT: + /* All RELOAD_FOR_OUTPUT reloads become live just after the + instruction is executed. */ + time2 = MAX_RECOG_OPERANDS * 4; + break; + /* The first RELOAD_FOR_OUTPUT_ADDRESS reload conflicts with the + RELOAD_FOR_OUTPUT reloads, so assign it the same time value. */ case RELOAD_FOR_OUTPUT_ADDRESS: time2 = MAX_RECOG_OPERANDS * 4 + reload_opnum[i]; break; -- 2.30.2