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 INSTALLED]: eliminate const_get_call_expr_in


This patch elimiates one of the two remaining "const_" functions as
previously requested.  I had been trying to eliminate both at the same
time, but kept running into a testsuite regression I couldn't figure out.
I suspect some sort of obvious cut-n-paste typo on my part, but for the
moment I don't see it.  So splitting this one out at least makes some
progress.

Tested on sparc-sun-solaris2.10, no regressions.

Installed on mainline.

		--Kaveh


2007-09-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* tree-cfg.c (is_ctrl_altering_stmt, tree_block_ends_with_call_p):
	Don't use const_get_call_expr_in.
	* tree-gimple.c (const_get_call_expr_in): Delete.
	* tree-gimple.h (const_get_call_expr_in): Likewise.

diff -rup orig/egcc-SVN20070914/gcc/tree-cfg.c egcc-SVN20070914/gcc/tree-cfg.c
--- orig/egcc-SVN20070914/gcc/tree-cfg.c	2007-09-08 23:02:45.000000000 -0400
+++ egcc-SVN20070914/gcc/tree-cfg.c	2007-09-15 14:17:25.168542932 -0400
@@ -2459,7 +2459,7 @@ is_ctrl_altering_stmt (const_tree t)
   const_tree call;

   gcc_assert (t);
-  call = const_get_call_expr_in (t);
+  call = get_call_expr_in (CONST_CAST_TREE (t));
   if (call)
     {
       /* A non-pure/const CALL_EXPR alters flow control if the current
@@ -6041,7 +6041,7 @@ static bool
 tree_block_ends_with_call_p (basic_block bb)
 {
   block_stmt_iterator bsi = bsi_last (bb);
-  return const_get_call_expr_in (bsi_stmt (bsi)) != NULL;
+  return get_call_expr_in (bsi_stmt (bsi)) != NULL;
 }


diff -rup orig/egcc-SVN20070914/gcc/tree-gimple.c egcc-SVN20070914/gcc/tree-gimple.c
--- orig/egcc-SVN20070914/gcc/tree-gimple.c	2007-08-27 00:10:34.000000000 -0400
+++ egcc-SVN20070914/gcc/tree-gimple.c	2007-09-15 14:17:25.169869792 -0400
@@ -436,28 +436,18 @@ is_gimple_call_addr (tree t)
 /* If T makes a function call, return the corresponding CALL_EXPR operand.
    Otherwise, return NULL_TREE.  */

-#define GET_CALL_EXPR_IN_BODY do { \
-  /* FIXME tuples: delete the assertion below when conversion complete.  */ \
-  gcc_assert (TREE_CODE (t) != MODIFY_EXPR); \
-  if (TREE_CODE (t) == GIMPLE_MODIFY_STMT) \
-    t = GIMPLE_STMT_OPERAND (t, 1); \
-  if (TREE_CODE (t) == WITH_SIZE_EXPR) \
-    t = TREE_OPERAND (t, 0); \
-  if (TREE_CODE (t) == CALL_EXPR) \
-    return t; \
-  return NULL_TREE; \
-} while (0)
-
 tree
 get_call_expr_in (tree t)
 {
-  GET_CALL_EXPR_IN_BODY;
-}
-
-const_tree
-const_get_call_expr_in (const_tree t)
-{
-  GET_CALL_EXPR_IN_BODY;
+  /* FIXME tuples: delete the assertion below when conversion complete.  */
+  gcc_assert (TREE_CODE (t) != MODIFY_EXPR);
+  if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
+    t = GIMPLE_STMT_OPERAND (t, 1);
+  if (TREE_CODE (t) == WITH_SIZE_EXPR)
+    t = TREE_OPERAND (t, 0);
+  if (TREE_CODE (t) == CALL_EXPR)
+    return t;
+  return NULL_TREE;
 }

 /* Given a memory reference expression T, return its base address.
diff -rup orig/egcc-SVN20070914/gcc/tree-gimple.h egcc-SVN20070914/gcc/tree-gimple.h
--- orig/egcc-SVN20070914/gcc/tree-gimple.h	2007-08-27 00:10:34.000000000 -0400
+++ egcc-SVN20070914/gcc/tree-gimple.h	2007-09-15 14:17:25.170579905 -0400
@@ -90,7 +90,6 @@ extern bool is_gimple_non_addressable (t
 extern bool is_gimple_call_addr (tree);
 /* If T makes a function call, returns the CALL_EXPR operand.  */
 extern tree get_call_expr_in (tree t);
-extern const_tree const_get_call_expr_in (const_tree t);

 extern void recalculate_side_effects (tree);


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