Patchwork [3/8] Fix usage of hard_regno_nregs before reload

login
register
mail settings
Submitter Alexander Monakov
Date Aug. 3, 2011, 3:30 p.m.
Message ID <1312385438-6273-4-git-send-email-amonakov@ispras.ru>
Download mbox | patch
Permalink /patch/108278/
State New
Headers show

Comments

Alexander Monakov - Aug. 3, 2011, 3:30 p.m.
From: Sergey Grechanik <mouseentity@gmail.com>

This fixes one place where hard_regno_nregs is incorrectly guarded by
reload_completed (as if before reload all regs are pseudos).

2011-08-04  Sergey Grechanik  <mouseentity@ispras.ru>

	* sel-sched.c (verify_target_availability): Fix usage of
	hard_regno_nregs.
Vladimir Makarov - Aug. 10, 2011, 7:46 p.m.
On 08/03/2011 11:30 AM, Alexander Monakov wrote:
> From: Sergey Grechanik<mouseentity@gmail.com>
>
> This fixes one place where hard_regno_nregs is incorrectly guarded by
> reload_completed (as if before reload all regs are pseudos).
>
> 2011-08-04  Sergey Grechanik<mouseentity@ispras.ru>
>
> 	* sel-sched.c (verify_target_availability): Fix usage of
> 	hard_regno_nregs.
>
Ok, thanks.

Patch

diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 92ba222..e791e4c 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -1581,7 +1581,7 @@  verify_target_availability (expr_t expr, regset used_regs,
   regno = expr_dest_regno (expr);
   mode = GET_MODE (EXPR_LHS (expr));
   target_available = EXPR_TARGET_AVAILABLE (expr) == 1;
-  n = reload_completed ? hard_regno_nregs[regno][mode] : 1;
+  n = HARD_REGISTER_NUM_P (regno) ? hard_regno_nregs[regno][mode] : 1;
 
   live_available = hard_available = true;
   for (i = 0; i < n; i++)