changeset 116:367f9f4f266e

fix gimple.h
author mir3636
date Tue, 28 Nov 2017 20:22:01 +0900
parents 4cb7a319550d
children f81c5aa9f14f
files gcc/c-family/c-pretty-print.c gcc/calls.c gcc/gimple.h
diffstat 3 files changed, 11 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/gcc/c-family/c-pretty-print.c	Tue Nov 28 19:31:15 2017 +0900
+++ b/gcc/c-family/c-pretty-print.c	Tue Nov 28 20:22:01 2017 +0900
@@ -29,7 +29,7 @@
 #include "intl.h"
 #include "tree-pretty-print.h"
 #ifndef noCbC
-#include "cbc-tree.h"
+#include "../c/cbc-tree.h"
 #endif
 
 /* The pretty-printer code is primarily designed to closely follow
--- a/gcc/calls.c	Tue Nov 28 19:31:15 2017 +0900
+++ b/gcc/calls.c	Tue Nov 28 20:22:01 2017 +0900
@@ -2759,7 +2759,7 @@
 }
 
 #ifndef noCbC
-#include "cbc-tree.h"
+#include "c/cbc-tree.h"
 #endif
 
 /* If X is a likely-spilled register value, copy it to a pseudo
@@ -3315,7 +3315,6 @@
     try_tail_call = 1;
 
   /*  Rest of purposes for tail call optimizations to fail.  */
-<<<<<<< local
   if (try_tail_call)
     try_tail_call = can_implement_as_sibling_call_p (exp,
 						     structure_value_addr,
@@ -3323,52 +3322,6 @@
 						     reg_parm_stack_space,
 						     fndecl,
 						     flags, addr, args_size);
-=======
-  if (
-#ifdef HAVE_sibcall_epilogue
-      !HAVE_sibcall_epilogue
-#else
-      1
-#endif
-      || !try_tail_call
-      /* Doing sibling call optimization needs some work, since
-	 structure_value_addr can be allocated on the stack.
-	 It does not seem worth the effort since few optimizable
-	 sibling calls will return a structure.  */
-      || structure_value_addr != NULL_RTX
-#ifdef REG_PARM_STACK_SPACE
-      /* If outgoing reg parm stack space changes, we can not do sibcall.  */
-      || (OUTGOING_REG_PARM_STACK_SPACE (funtype)
-	  != OUTGOING_REG_PARM_STACK_SPACE (TREE_TYPE (current_function_decl)))
-      || (reg_parm_stack_space != REG_PARM_STACK_SPACE (fndecl))
-#endif
-      /* Check whether the target is able to optimize the call
-	 into a sibcall.  */
-      || !targetm.function_ok_for_sibcall (fndecl, exp)
-      /* Functions that do not return exactly once may not be sibcall
-	 optimized.  */
-      || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN))
-      || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr)))
-      /* If the called function is nested in the current one, it might access
-	 some of the caller's arguments, but could clobber them beforehand if
-	 the argument areas are shared.  */
-      || (fndecl && decl_function_context (fndecl) == current_function_decl)
-      /* If this function requires more stack slots than the current
-	 function, we cannot change it into a sibling call.
-	 crtl->args.pretend_args_size is not part of the
-	 stack allocated by our caller.  */
-      || args_size.constant > (crtl->args.size
-                               - crtl->args.pretend_args_size)
-      /* If the callee pops its own arguments, then it must pop exactly
-	 the same number of arguments as the current function.  */
-      || (targetm.calls.return_pops_args (fndecl, funtype, args_size.constant)
-	  != targetm.calls.return_pops_args (current_function_decl,
-					     TREE_TYPE (current_function_decl),
-					     crtl->args.size))
-      || !lang_hooks.decls.ok_for_sibcall (fndecl))
-    try_tail_call = 0;
->>>>>>> other
-
 
   /* Check if caller and callee disagree in promotion of function
      return value.  */
--- a/gcc/gimple.h	Tue Nov 28 19:31:15 2017 +0900
+++ b/gcc/gimple.h	Tue Nov 28 20:22:01 2017 +0900
@@ -3245,13 +3245,13 @@
    candidate for tail call optimization.  */
 
 static inline void
-gimple_call_set_cbc_goto (gimple s, bool cbcgoto_p)
+gimple_call_set_cbc_goto (gimple *s, bool cbcgoto_p)
 {
   GIMPLE_CHECK (s, GIMPLE_CALL);
   if (cbcgoto_p)
-    s->gsbase.subcode |= GF_CALL_CBC_GOTO;
+    s->subcode |= GF_CALL_CBC_GOTO;
   else
-    s->gsbase.subcode &= ~GF_CALL_CBC_GOTO;
+    s->subcode &= ~GF_CALL_CBC_GOTO;
 }
 #endif
 
@@ -3270,19 +3270,20 @@
 {
   if (must_tail_p)
     s->subcode |= GF_CALL_MUST_TAIL_CALL;
+  else
+    s->subcode &= ~GF_CALL_MUST_TAIL_CALL;
+}
+
 #ifndef noCbC
 /* Return true if GIMPLE_CALL S is marked as a cbc goto.  */
 
 static inline bool
-gimple_call_cbc_goto_p (gimple s)
+gimple_call_cbc_goto_p (gimple *s)
 {
   GIMPLE_CHECK (s, GIMPLE_CALL);
-  return (s->gsbase.subcode & GF_CALL_CBC_GOTO) != 0;
+  return (s->subcode & GF_CALL_CBC_GOTO) != 0;
 }
 #endif
-  else
-    s->subcode &= ~GF_CALL_MUST_TAIL_CALL;
-}
 
 /* Return true if call statement has been marked as requiring
    tail call optimization.  */