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] builtins.c: Remove redundant code.


Hi,

Attached is a patch to remove redundant code.  any_condjump_p()
checks both

  pc_set (insn) == NULL_RTX

and

  GET_CODE (SET_SRC (pc_set (insn))) == IF_THEN_ELSE

So the patch removes the redundant tests on the caller side.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2003-06-14  Kazu Hirata  <kazu@cs.umass.edu>

	* builtins.c (expand_builtin_expect_jump): Remove redundant
	tests that are also in any_condjump_p().

Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.211
diff -c -r1.211 builtins.c
*** builtins.c	13 Jun 2003 17:30:50 -0000	1.211
--- builtins.c	14 Jun 2003 16:15:22 -0000
***************
*** 4248,4264 ****
        while (insn != NULL_RTX)
  	{
  	  rtx next = NEXT_INSN (insn);
- 	  rtx pattern;
  
! 	  if (GET_CODE (insn) == JUMP_INSN && any_condjump_p (insn)
! 	      && (pattern = pc_set (insn)) != NULL_RTX)
  	    {
! 	      rtx ifelse = SET_SRC (pattern);
  	      rtx label;
  	      int taken;
- 
- 	      if (GET_CODE (ifelse) != IF_THEN_ELSE)
- 		goto do_next_insn;
  
  	      if (GET_CODE (XEXP (ifelse, 1)) == LABEL_REF)
  		{
--- 4248,4259 ----
        while (insn != NULL_RTX)
  	{
  	  rtx next = NEXT_INSN (insn);
  
! 	  if (GET_CODE (insn) == JUMP_INSN && any_condjump_p (insn))
  	    {
! 	      rtx ifelse = SET_SRC (pc_set (insn));
  	      rtx label;
  	      int taken;
  
  	      if (GET_CODE (XEXP (ifelse, 1)) == LABEL_REF)
  		{


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