This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
regclass warning fix
- To: rth at cygnus dot com, gcc-patches at gcc dot gnu dot org
- Subject: regclass warning fix
- From: Jan Hubicka <jh at suse dot cz>
- Date: Tue, 13 Feb 2001 22:59:02 +0100
Hi
This patch fixes the warning about ambiguous if. Also I've changed
array from LIM_REG_CLASSES to N_REG_CLASSES, since this constant is
used elsewhere.
OK for 3.0 branch too?
Honza
Tue Feb 13 22:57:50 CET 2001 Jan Hubicka <jh@suse.cz>
* regclass.c (init_reg_sets_1): Silence warning.
Index: egcs/gcc/regclass.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/regclass.c,v
retrieving revision 1.112
diff -c -3 -p -r1.112 regclass.c
*** regclass.c 2001/02/12 16:30:08 1.112
--- regclass.c 2001/02/13 21:56:47
*************** init_reg_sets_1 ()
*** 288,294 ****
{
register unsigned int i, j;
register unsigned int /* enum machine_mode */ m;
! char contains_reg_of_mode [LIM_REG_CLASSES] [MAX_MACHINE_MODE];
char allocatable_regs_of_mode [MAX_MACHINE_MODE];
/* This macro allows the fixed or call-used registers
--- 288,294 ----
{
register unsigned int i, j;
register unsigned int /* enum machine_mode */ m;
! char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
char allocatable_regs_of_mode [MAX_MACHINE_MODE];
/* This macro allows the fixed or call-used registers
*************** init_reg_sets_1 ()
*** 443,495 ****
for (m = 0; m < MAX_MACHINE_MODE; m++)
if (allocatable_regs_of_mode [m])
! for (i = 0; i < N_REG_CLASSES; i++)
! if (contains_reg_of_mode [i][m])
! for (j = 0; j < N_REG_CLASSES; j++)
! {
! int cost;
! enum reg_class *p1, *p2;
!
! if (!contains_reg_of_mode [j][m])
! {
! move_cost[m][i][j] = 65536;
! may_move_in_cost[m][i][j] = 65536;
! may_move_out_cost[m][i][j] = 65536;
! }
! else
! {
! cost = i == j ? 2 : REGISTER_MOVE_COST (m, i, j);
!
! for (p2 = ®_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES;
! p2++)
! if (*p2 != i && contains_reg_of_mode [*p1][m])
! cost = MAX (cost, move_cost [m][i][*p2]);
!
! for (p1 = ®_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES;
! p1++)
! if (*p1 != j && contains_reg_of_mode [*p1][m])
! cost = MAX (cost, move_cost [m][*p1][j]);
!
! move_cost[m][i][j] = cost;
!
! if (reg_class_subset_p (i, j))
! may_move_in_cost[m][i][j] = 0;
! else
! may_move_in_cost[m][i][j] = cost;
!
! if (reg_class_subset_p (j, i))
! may_move_out_cost[m][i][j] = 0;
! else
! may_move_out_cost[m][i][j] = cost;
! }
! }
! else
! for (j = 0; j < N_REG_CLASSES; j++)
! {
! move_cost[m][i][j] = 65536;
! may_move_in_cost[m][i][j] = 65536;
! may_move_out_cost[m][i][j] = 65536;
! }
#ifdef CLASS_CANNOT_CHANGE_MODE
{
--- 443,499 ----
for (m = 0; m < MAX_MACHINE_MODE; m++)
if (allocatable_regs_of_mode [m])
! {
! for (i = 0; i < N_REG_CLASSES; i++)
! if (contains_reg_of_mode [i][m])
! for (j = 0; j < N_REG_CLASSES; j++)
! {
! int cost;
! enum reg_class *p1, *p2;
!
! if (!contains_reg_of_mode [j][m])
! {
! move_cost[m][i][j] = 65536;
! may_move_in_cost[m][i][j] = 65536;
! may_move_out_cost[m][i][j] = 65536;
! }
! else
! {
! cost = i == j ? 2 : REGISTER_MOVE_COST (m, i, j);
!
! for (p2 = ®_class_subclasses[j][0];
! *p2 != LIM_REG_CLASSES;
! p2++)
! if (*p2 != i && contains_reg_of_mode [*p1][m])
! cost = MAX (cost, move_cost [m][i][*p2]);
!
! for (p1 = ®_class_subclasses[i][0];
! *p1 != LIM_REG_CLASSES;
! p1++)
! if (*p1 != j && contains_reg_of_mode [*p1][m])
! cost = MAX (cost, move_cost [m][*p1][j]);
!
! move_cost[m][i][j] = cost;
!
! if (reg_class_subset_p (i, j))
! may_move_in_cost[m][i][j] = 0;
! else
! may_move_in_cost[m][i][j] = cost;
!
! if (reg_class_subset_p (j, i))
! may_move_out_cost[m][i][j] = 0;
! else
! may_move_out_cost[m][i][j] = cost;
! }
! }
! else
! for (j = 0; j < N_REG_CLASSES; j++)
! {
! move_cost[m][i][j] = 65536;
! may_move_in_cost[m][i][j] = 65536;
! may_move_out_cost[m][i][j] = 65536;
! }
! }
#ifdef CLASS_CANNOT_CHANGE_MODE
{