This is the mail archive of the 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]

Remove a parameter from combine_simplify_rtx

This parameter looks like an unnecessary complication more than
a useful knob to have.  A single simplification is done only if
it is true.


2004-02-17  Paolo Bonzini  <>

	* combine.c (combine_simplify_rtx): Remove the "last"
	parameter.  Adjust recursive calls.
	(simplify_logical): Always perform the only simplification
	controlled by "last".
	(try_combine): Do not pass the "last" parameter to

Index: combine.c
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.408
diff -u -r1.408 combine.c
--- combine.c	3 Feb 2004 05:15:35 -0000	1.408
+++ combine.c	17 Feb 2004 17:04:33 -0000
@@ -352,10 +352,10 @@
 static void undo_commit (void);
 static rtx *find_split_point (rtx *, rtx);
 static rtx subst (rtx, rtx, rtx, int, int);
-static rtx combine_simplify_rtx (rtx, enum machine_mode, int, int);
+static rtx combine_simplify_rtx (rtx, enum machine_mode, int);
 static rtx simplify_if_then_else (rtx);
 static rtx simplify_set (rtx);
-static rtx simplify_logical (rtx, int);
+static rtx simplify_logical (rtx);
 static rtx expand_compound_operation (rtx);
 static rtx expand_field_assignment (rtx);
 static rtx make_extraction (enum machine_mode, rtx, HOST_WIDE_INT,
@@ -3515,7 +3515,7 @@
       /* If X is sufficiently simple, don't bother trying to do anything
 	 with it.  */
       if (code != CONST_INT && code != REG && code != CLOBBER)
-	x = combine_simplify_rtx (x, op0_mode, i == 3, in_dest);
+	x = combine_simplify_rtx (x, op0_mode, in_dest);
       if (GET_CODE (x) == code)
@@ -3539,7 +3539,7 @@
    X is returned; IN_DEST is nonzero if we are inside a SET_DEST.  */
 static rtx
-combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
+combine_simplify_rtx (rtx x, enum machine_mode op0_mode,
 		      int in_dest)
   enum rtx_code code = GET_CODE (x);
@@ -4207,7 +4207,7 @@
 	  /* Try to simplify the expression further.  */
 	  rtx tor = gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1));
-	  temp = combine_simplify_rtx (tor, mode, last, in_dest);
+	  temp = combine_simplify_rtx (tor, mode, in_dest);
 	  /* If we could, great.  If not, do not go ahead with the IOR
 	     replacement, since PLUS appears in many special purpose
@@ -4492,7 +4492,7 @@
     case AND:
     case IOR:
     case XOR:
-      return simplify_logical (x, last);
+      return simplify_logical (x);
     case ABS:
       /* (abs (neg <foo>)) -> (abs <foo>) */
@@ -5277,7 +5277,7 @@
    result.  LAST is nonzero if this is the last retry.  */
 static rtx
-simplify_logical (rtx x, int last)
+simplify_logical (rtx x)
   enum machine_mode mode = GET_MODE (x);
   rtx op0 = XEXP (x, 0);
@@ -5325,11 +5325,9 @@
 	  x = simplify_and_const_int (x, mode, op0, INTVAL (op1));
-	  /* If we have (ior (and (X C1) C2)) and the next restart would be
-	     the last, simplify this by making C1 as small as possible
-	     and then exit.  */
-	  if (last
-	      && GET_CODE (x) == IOR && GET_CODE (op0) == AND
+	  /* If we have (ior (and (X C1) C2)), simplify this by making C1 as
+	     small as possible.  */
+	  if (GET_CODE (x) == IOR && GET_CODE (op0) == AND
 	      && GET_CODE (XEXP (op0, 1)) == CONST_INT
 	      && GET_CODE (op1) == CONST_INT)
 	    return gen_binary (IOR, mode,

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