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] emit-rtl.c: Remove reverse_comparison.


Hi,

Attached is a patch to remove reverse_comparison as it is unused.

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

Kazu Hirata

2005-03-22  Kazu Hirata  <kazu@cs.umass.edu>

	* emit-rtl.c (reverse_comparison): Remove.
	* rtl.h: Remove the corresponding prototype.

Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.435
diff -u -d -p -r1.435 emit-rtl.c
--- emit-rtl.c	28 Feb 2005 18:18:23 -0000	1.435
+++ emit-rtl.c	22 Mar 2005 19:58:27 -0000
@@ -1360,38 +1360,6 @@ operand_subword_force (rtx op, unsigned 
   return result;
 }
 
-/* Given a compare instruction, swap the operands.
-   A test instruction is changed into a compare of 0 against the operand.  */
-
-void
-reverse_comparison (rtx insn)
-{
-  rtx body = PATTERN (insn);
-  rtx comp;
-
-  if (GET_CODE (body) == SET)
-    comp = SET_SRC (body);
-  else
-    comp = SET_SRC (XVECEXP (body, 0, 0));
-
-  if (GET_CODE (comp) == COMPARE)
-    {
-      rtx op0 = XEXP (comp, 0);
-      rtx op1 = XEXP (comp, 1);
-      XEXP (comp, 0) = op1;
-      XEXP (comp, 1) = op0;
-    }
-  else
-    {
-      rtx new = gen_rtx_COMPARE (VOIDmode,
-				 CONST0_RTX (GET_MODE (comp)), comp);
-      if (GET_CODE (body) == SET)
-	SET_SRC (body) = new;
-      else
-	SET_SRC (XVECEXP (body, 0, 0)) = new;
-    }
-}
-
 /* Within a MEM_EXPR, we care about either (1) a component ref of a decl,
    or (2) a component ref of something variable.  Represent the later with
    a NULL expression.  */
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.542
diff -u -d -p -r1.542 rtl.h
--- rtl.h	21 Mar 2005 14:38:01 -0000	1.542
+++ rtl.h	22 Mar 2005 19:58:32 -0000
@@ -1942,7 +1942,6 @@ extern void init_emit (void);
 extern void init_emit_once (int);
 extern void push_topmost_sequence (void);
 extern void pop_topmost_sequence (void);
-extern void reverse_comparison (rtx);
 extern void set_new_first_and_last_insn (rtx, rtx);
 extern void unshare_all_rtl (void);
 extern void unshare_all_rtl_again (rtx);


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