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]

[gimple-classes, committed 78/92] Tweak to gimplify_modify_expr


This corresponds to:
  [PATCH 80/89] Tweak to gimplify_modify_expr
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01189.html
from the original 89-patch kit

That earlier patch was approved by Jeff:
> OK once prerequisites have gone in.
in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00842.html

gcc/
	* gimplify.c (gimplify_modify_expr): Introduce local "call_stmt".
---
 gcc/ChangeLog.gimple-classes |  6 ++++++
 gcc/gimplify.c               | 20 +++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 503fff5..37e3955 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,11 @@
 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
 
+	Tweak to gimplify_modify_expr
+
+	* gimplify.c (gimplify_modify_expr): Introduce local "call_stmt".
+
+2014-10-24  David Malcolm  <dmalcolm@redhat.com>
+
 	Concretize gimple_call_nothrow_p
 
 	* gimple.h (gimple_call_nothrow_p): Require a gimple_call.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index b49aab7..037fb2b 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4624,22 +4624,24 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
       CALL_EXPR_FN (*from_p) = TREE_OPERAND (CALL_EXPR_FN (*from_p), 0);
       STRIP_USELESS_TYPE_CONVERSION (CALL_EXPR_FN (*from_p));
       tree fndecl = get_callee_fndecl (*from_p);
+      gimple_call call_stmt;
       if (fndecl
 	  && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
 	  && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
 	  && call_expr_nargs (*from_p) == 3)
-	assign = gimple_build_call_internal (IFN_BUILTIN_EXPECT, 3,
-					     CALL_EXPR_ARG (*from_p, 0),
-					     CALL_EXPR_ARG (*from_p, 1),
-					     CALL_EXPR_ARG (*from_p, 2));
+	call_stmt = gimple_build_call_internal (IFN_BUILTIN_EXPECT, 3,
+						CALL_EXPR_ARG (*from_p, 0),
+						CALL_EXPR_ARG (*from_p, 1),
+						CALL_EXPR_ARG (*from_p, 2));
       else
 	{
-	  assign = gimple_build_call_from_tree (*from_p);
-	  gimple_call_set_fntype (assign, TREE_TYPE (fnptrtype));
+	  call_stmt = gimple_build_call_from_tree (*from_p);
+	  gimple_call_set_fntype (call_stmt, TREE_TYPE (fnptrtype));
 	}
-      notice_special_calls (as_a <gimple_call> (assign));
-      if (!gimple_call_noreturn_p (assign))
-	gimple_call_set_lhs (assign, *to_p);
+      notice_special_calls (call_stmt);
+      if (!gimple_call_noreturn_p (call_stmt))
+	gimple_call_set_lhs (call_stmt, *to_p);
+      assign = call_stmt;
     }
   else
     {
-- 
1.8.5.3


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