This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

another regclass warning fix


Howdy,

When computing the move_cost array, while transversing the
register class subclasses of the destination, the code is
incorrectly using p1 instead of p2.  I found this due to a
compiler warning about p1 being uninitialized.  It compiles on
i586-pc-linux-gnu, but I was too impatient to wait for a full
bootstrap to complete.

It also gets rid of some extra spaces a few lines down.

The same problem appears to be present on the GCC 3.0 branch.

Matt

2001-02-13  Matt Kraai  <kraai@alumni.carnegiemellon.edu>

	* regclass.c (init_reg_sets_1): Fix uninitialized variable.

Index: regclass.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regclass.c,v
retrieving revision 1.113
diff -c -3 -p -r1.113 regclass.c
*** regclass.c	2001/02/13 22:10:04	1.113
--- regclass.c	2001/02/14 05:43:56
*************** init_reg_sets_1 ()
*** 464,474 ****
  		    for (p2 = &reg_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 = &reg_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]);
--- 464,474 ----
  		    for (p2 = &reg_class_subclasses[j][0];
  		         *p2 != LIM_REG_CLASSES;
  			 p2++)
! 		      if (*p2 != i && contains_reg_of_mode [*p2][m])
  			cost = MAX (cost, move_cost [m][i][*p2]);
  
  		    for (p1 = &reg_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]);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]