[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #10 from amylaar at gcc dot gnu dot org 2009-03-08 16:35 --- (In reply to comment #3) I've checked the old RA. It does not assigned partially clobbered hard register because it is done only when non partially clobbered hard regs were tried first. Sh has a lot of such registers therefore the chance to generate wrong code is small. I can simulate the same behaviour for IRA by increasing costs for partially clobbered hard registers. Currently rs6000 and sh define HARD_REGNO_CALL_PART_CLOBBERED. So even the problem is solved for sh in different way, the patch increasing cost would be useful for rs6000. Still, as I wrote, the complete solution (the mentioned cost increase will be still necessary in any case) would be save and restore partially clobbered hard-registers in caller-saves.c. To avoid pessimizing code where partially clobbered registers are used to allocate pseudos which are not affected by the partial clobbers, the register allocator will have to provide caller_save.c with more information. It needs to know which registers are live across a call in excess of the part that is saved. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #8 from andreasmeier80 at gmx dot de 2009-01-02 17:08 --- What is the status of this bug? -- andreasmeier80 at gmx dot de changed: What|Removed |Added CC||andreasmeier80 at gmx dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #9 from kkojima at gcc dot gnu dot org 2009-01-02 22:51 --- The failure itself went away but requested to stay open. See the thread http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00606.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #7 from kkojima at gcc dot gnu dot org 2008-10-21 23:42 --- Subject: Bug 37633 Author: kkojima Date: Tue Oct 21 23:40:41 2008 New Revision: 141282 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=141282 Log: PR target/37633 * config/sh/sh.c (sh_hard_regno_mode_ok): New function. * config/sh/sh.h (HARD_REGNO_MODE_OK): Use it. * config/sh/sh-protos.h (sh_hard_regno_mode_ok): Declare. Modified: trunk/gcc/ChangeLog trunk/gcc/config/sh/sh-protos.h trunk/gcc/config/sh/sh.c trunk/gcc/config/sh/sh.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #5 from kkojima at gcc dot gnu dot org 2008-10-15 23:14 --- Thanks for taking a look at this problem. Your patch mentioned in #3 fixes the test case in #1 on sh64. Even with it, there are similar failures with -O0 in the result of the gcc testsuite on sh64-linux. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #6 from vmakarov at gcc dot gnu dot org 2008-10-16 00:54 --- Subject: Bug 37633 Author: vmakarov Date: Thu Oct 16 00:52:59 2008 New Revision: 141161 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=141161 Log: 2008-10-14 Vladimir Makarov [EMAIL PROTECTED] PR target/37633 * ira-costs.c (ira_tune_allocno_costs_and_cover_classes): Check HARD_REGNO_CALL_PART_CLOBBERED. Modified: trunk/gcc/ChangeLog trunk/gcc/ira-costs.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #3 from vmakarov at redhat dot com 2008-10-14 19:42 --- I've checked the old RA. It does not assigned partially clobbered hard register because it is done only when non partially clobbered hard regs were tried first. Sh has a lot of such registers therefore the chance to generate wrong code is small. I can simulate the same behaviour for IRA by increasing costs for partially clobbered hard registers. Currently rs6000 and sh define HARD_REGNO_CALL_PART_CLOBBERED. So even the problem is solved for sh in different way, the patch increasing cost would be useful for rs6000. Still, as I wrote, the complete solution (the mentioned cost increase will be still necessary in any case) would be save and restore partially clobbered hard-registers in caller-saves.c. The patch increasing the costs will be sent later today. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #4 from hjl at gcc dot gnu dot org 2008-10-14 22:24 --- Subject: Bug 37633 Author: hjl Date: Tue Oct 14 22:23:23 2008 New Revision: 141120 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=141120 Log: 2008-10-14 Vladimir Makarov [EMAIL PROTECTED] PR target/37633 * ira-costs.c (ira_tune_allocno_costs_and_cover_classes): Check HARD_REGNO_CALL_PART_CLOBBERED. Modified: branches/ira-merge/gcc/ChangeLog.ira branches/ira-merge/gcc/ira-costs.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #2 from vmakarov at redhat dot com 2008-10-08 21:55 --- Thanks for working on the problem. I am afraid that preventing to use partially clobbered hard regs for allocnos living through calls is wrong. In most general case I believe the problem should be fixed in caller-saves.c: they should saved and restored around calls. As temporary workaround would be correct calculation of costs in IRA for partially clobbered hard regs (as it was done in global.c) in order to force IRA avoid the hard regs. But without fixing the problem in caller-saves.c IRA and the old RA are still error-prune for this problem in general case. I'll work on the patch for correct partially clobbered hard register calculation. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
--- Comment #1 from kkojima at gcc dot gnu dot org 2008-09-26 03:31 --- I've tried --- ORIG/trunk/gcc/ira-color.c Wed Sep 17 09:48:49 2008 +++ LOCAL/trunk/gcc/ira-color.c Thu Sep 25 12:09:30 2008 @@ -514,7 +514,9 @@ assign_hard_reg (ira_allocno_t allocno, #endif if (! ira_hard_reg_not_in_set_p (hard_regno, mode, conflicting_regs) || TEST_HARD_REG_BIT (prohibited_class_mode_regs[cover_class][mode], - hard_regno)) + hard_regno) + || (ALLOCNO_CALLS_CROSSED_NUM (allocno) != 0 + HARD_REGNO_CALL_PART_CLOBBERED (hard_regno, mode))) continue; cost = costs[i]; full_cost = full_costs[i]; @@ -3064,7 +3066,9 @@ ira_fast_allocation (void) #endif if (!ira_hard_reg_not_in_set_p (hard_regno, mode, conflict_hard_regs) || (TEST_HARD_REG_BIT - (prohibited_class_mode_regs[cover_class][mode], hard_regno))) + (prohibited_class_mode_regs[cover_class][mode], hard_regno)) + || (ALLOCNO_CALLS_CROSSED_NUM (a) != 0 + HARD_REGNO_CALL_PART_CLOBBERED (hard_regno, mode))) continue; ALLOCNO_HARD_REGNO (a) = hard_regno; for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r-next) It works for me, though it could be completely wrong. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
-- kkojima at gcc dot gnu dot org changed: What|Removed |Added Priority|P3 |P4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633
[Bug target/37633] [4.4 Regression] wrong register use on sh64
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||pinskia at gcc dot gnu dot ||org Target Milestone|--- |4.4.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633