[PATCH] Remove rtl_expr_nonnegative_p

Andrew Pinski pinskia@physics.uc.edu
Sun Aug 22 09:25:00 GMT 2004


Now that RTL_EXPR has been removed we can also remove the function
rtl_expr_nonnegative_p as it is no longer called from anywhere.

This patch removes that function.


OK? Bootstrapped on powerpc-apple-darwin with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

	* fold-const.c (rtl_expr_nonnegative_p): Delete.
	* tree.h (rtl_expr_nonnegative_p): Remove.


Patch:
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.440
diff -u -p -r1.440 fold-const.c
--- fold-const.c	20 Aug 2004 16:09:00 -0000	1.440
+++ fold-const.c	22 Aug 2004 07:07:57 -0000
@@ -9700,50 +9700,6 @@ tree_expr_nonzero_p (tree t)
    return false;
  }

-/* Return true if `r' is known to be non-negative.
-   Only handles constants at the moment.  */
-
-int
-rtl_expr_nonnegative_p (rtx r)
-{
-  switch (GET_CODE (r))
-    {
-    case CONST_INT:
-      return INTVAL (r) >= 0;
-
-    case CONST_DOUBLE:
-      if (GET_MODE (r) == VOIDmode)
-	return CONST_DOUBLE_HIGH (r) >= 0;
-      return 0;
-
-    case CONST_VECTOR:
-      {
-	int units, i;
-	rtx elt;
-
-	units = CONST_VECTOR_NUNITS (r);
-
-	for (i = 0; i < units; ++i)
-	  {
-	    elt = CONST_VECTOR_ELT (r, i);
-	    if (!rtl_expr_nonnegative_p (elt))
-	      return 0;
-	  }
-
-	return 1;
-      }
-
-    case SYMBOL_REF:
-    case LABEL_REF:
-      /* These are always nonnegative.  */
-      return 1;
-
-    default:
-      return 0;
-    }
-}
-
-
  /* See if we are applying CODE, a relational to the highest or lowest
     possible integer of TYPE.  If so, then the result is a compile
     time constant.  */
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.596
diff -u -p -r1.596 tree.h
--- tree.h	19 Aug 2004 21:34:28 -0000	1.596
+++ tree.h	22 Aug 2004 07:08:02 -0000
@@ -2798,7 +2798,6 @@ extern HOST_WIDE_INT tree_low_cst (tree,
  extern int tree_int_cst_msb (tree);
  extern int tree_int_cst_sgn (tree);
  extern int tree_expr_nonnegative_p (tree);
-extern int rtl_expr_nonnegative_p (rtx);
  extern tree get_inner_array_type (tree);

  /* From expmed.c.  Since rtl.h is included after tree.h, we can't



More information about the Gcc-patches mailing list