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]

combine.c patch to delete unused function


I noticed this when looking at Michael Matz's question about the definition of
FUNCTION_ARG_REGNO_P in the ia64 port.

There is a function in combine.c that uses this macro that is not used anywhere
except for recursive calls.  The only use of this function was deleted by
this patch from Bernd Schmidt in December 2000.
	http://gcc.gnu.org/ml/gcc-patches/2000-12/msg00005.html

I tested this with an x86 linux C/C++ bootstrap.  Since this is just deleting
an unused function, I didn't think it needed a time consuming full bootstrap
and regression test.
	
2003-11-19  James E Wilson  <wilson@specifixinc.com>

	* combine.c (sets_function_arg_p): Delete unused function.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.394
diff -p -r1.394 combine.c
*** combine.c	17 Oct 2003 13:36:48 -0000	1.394
--- combine.c	19 Nov 2003 23:04:25 -0000
*************** static void setup_incoming_promotions (v
*** 345,351 ****
  static void set_nonzero_bits_and_sign_copies (rtx, rtx, void *);
  static int cant_combine_insn_p (rtx);
  static int can_combine_p (rtx, rtx, rtx, rtx, rtx *, rtx *);
- static int sets_function_arg_p (rtx);
  static int combinable_i3pat (rtx, rtx *, rtx, rtx, int, rtx *);
  static int contains_muldiv (rtx);
  static rtx try_combine (rtx, rtx, rtx, int *);
--- 345,350 ----
*************** can_combine_p (rtx insn, rtx i3, rtx pre
*** 1205,1249 ****
    return 1;
  }
  
- /* Check if PAT is an insn - or a part of it - used to set up an
-    argument for a function in a hard register.  */
- 
- static int
- sets_function_arg_p (rtx pat)
- {
-   int i;
-   rtx inner_dest;
- 
-   switch (GET_CODE (pat))
-     {
-     case INSN:
-       return sets_function_arg_p (PATTERN (pat));
- 
-     case PARALLEL:
-       for (i = XVECLEN (pat, 0); --i >= 0;)
- 	if (sets_function_arg_p (XVECEXP (pat, 0, i)))
- 	  return 1;
- 
-       break;
- 
-     case SET:
-       inner_dest = SET_DEST (pat);
-       while (GET_CODE (inner_dest) == STRICT_LOW_PART
- 	     || GET_CODE (inner_dest) == SUBREG
- 	     || GET_CODE (inner_dest) == ZERO_EXTRACT)
- 	inner_dest = XEXP (inner_dest, 0);
- 
-       return (GET_CODE (inner_dest) == REG
- 	      && REGNO (inner_dest) < FIRST_PSEUDO_REGISTER
- 	      && FUNCTION_ARG_REGNO_P (REGNO (inner_dest)));
- 
-     default:
-       break;
-     }
- 
-   return 0;
- }
- 
  /* LOC is the location within I3 that contains its pattern or the component
     of a PARALLEL of the pattern.  We validate that it is valid for combining.
  
--- 1204,1209 ----
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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