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]
Other format: [Raw text]

[patch] Remove duplicated function from global.c


Hi,

In global.c we have regclass_intersect() and in regclass.c we have
reg_classes_intersect_p().  Both functions do the same thing (the
latter a tad more efficiently), so probably Vlad just overlooked it
one in regclass.c when he added the new one to global.c a couple of
months ago.

Bootstrap and testing in progress (x86_64-linux).  OK if it passes?

Gr.
Steven

	* global.c (regclass_intersect): Remove.
	(mark_reg_use_for_earlyclobber): Use reg_classes_intersect_p instead.

Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.120
diff -c -3 -p -r1.120 global.c
*** global.c	16 Dec 2004 21:57:49 -0000	1.120
--- global.c	29 Dec 2004 23:34:47 -0000
*************** static void reg_dies (int, enum machine_
*** 309,315 ****
  static void allocate_bb_info (void);
  static void free_bb_info (void);
  static bool check_earlyclobber (rtx);
- static bool regclass_intersect (enum reg_class, enum reg_class);
  static void mark_reg_use_for_earlyclobber_1 (rtx *, void *);
  static int mark_reg_use_for_earlyclobber (rtx *, void *);
  static void calculate_local_reg_bb_info (void);
--- 309,314 ----
*************** check_earlyclobber (rtx insn)
*** 2180,2201 ****
    return found;
  }
  
- /* The function returns true if register classes C1 and C2 intersect.  */
- 
- static bool
- regclass_intersect (enum reg_class c1, enum reg_class c2)
- {
-   HARD_REG_SET rs, zero;
- 
-   CLEAR_HARD_REG_SET (zero);
-   COPY_HARD_REG_SET(rs, reg_class_contents [c1]);
-   AND_HARD_REG_SET (rs, reg_class_contents [c2]);
-   GO_IF_HARD_REG_EQUAL (zero, rs, yes);
-   return true;
-  yes:
-   return false;
- }
- 
  /* The function checks that pseudo-register *X has a class
     intersecting with the class of pseudo-register could be early
     clobbered in the same insn.
--- 2179,2184 ----
*************** mark_reg_use_for_earlyclobber (rtx *x, v
*** 2218,2228 ****
        pref_class = reg_preferred_class (regno);
        alt_class = reg_alternate_class (regno);
        for (i = VARRAY_ACTIVE_SIZE (earlyclobber_regclass) - 1; i >= 0; i--)
! 	if (regclass_intersect (VARRAY_INT (earlyclobber_regclass, i),
! 				pref_class)
  	    || (VARRAY_INT (earlyclobber_regclass, i) != NO_REGS
! 		&& regclass_intersect (VARRAY_INT (earlyclobber_regclass, i),
! 				       alt_class)))
  	  {
  	    bitmap_set_bit (bb_info->earlyclobber, regno);
  	    break;
--- 2201,2212 ----
        pref_class = reg_preferred_class (regno);
        alt_class = reg_alternate_class (regno);
        for (i = VARRAY_ACTIVE_SIZE (earlyclobber_regclass) - 1; i >= 0; i--)
! 	if (reg_classes_intersect_p (VARRAY_INT (earlyclobber_regclass, i),
! 				     pref_class)
  	    || (VARRAY_INT (earlyclobber_regclass, i) != NO_REGS
! 		&& reg_classes_intersect_p (VARRAY_INT (earlyclobber_regclass,
! 							i),
! 					    alt_class)))
  	  {
  	    bitmap_set_bit (bb_info->earlyclobber, regno);
  	    break;


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