OSDN Git Service

* config/m32c/m32c-protos.h (m32c_function_arg): Delete.
[pf3gnuchains/gcc-fork.git] / gcc / tree-tailcall.c
index a9f0191..65eaa40 100644 (file)
@@ -23,14 +23,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
-#include "rtl.h"
 #include "tm_p.h"
-#include "hard-reg-set.h"
 #include "basic-block.h"
 #include "function.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
-#include "diagnostic.h"
+#include "gimple-pretty-print.h"
 #include "except.h"
 #include "tree-pass.h"
 #include "flags.h"
@@ -166,7 +164,7 @@ suitable_for_tail_call_opt_p (void)
      but not in all cases.  See PR15387 and PR19616.  Revisit for 4.1.  */
   for (param = DECL_ARGUMENTS (current_function_decl);
        param;
-       param = TREE_CHAIN (param))
+       param = DECL_CHAIN (param))
     if (TREE_ADDRESSABLE (param))
       return false;
 
@@ -425,7 +423,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
 
       for (param = DECL_ARGUMENTS (func), idx = 0;
           param && idx < gimple_call_num_args (call);
-          param = TREE_CHAIN (param), idx ++)
+          param = DECL_CHAIN (param), idx ++)
        {
          arg = gimple_call_arg (call, idx);
          if (param != arg)
@@ -460,7 +458,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
     {
       if (TREE_CODE (var) != PARM_DECL
          && auto_var_in_fn_p (var, cfun->decl)
-         && ref_maybe_used_by_stmt_p (call, var))
+         && (ref_maybe_used_by_stmt_p (call, var)
+             || call_may_clobber_ref_p (call, var)))
        return;
     }
 
@@ -809,7 +808,7 @@ eliminate_tail_call (struct tailcall *t)
   for (param = DECL_ARGUMENTS (current_function_decl),
         idx = 0, gsi = gsi_start_phis (first);
        param;
-       param = TREE_CHAIN (param), idx++)
+       param = DECL_CHAIN (param), idx++)
     {
       if (!arg_needs_copy_p (param))
        continue;
@@ -966,7 +965,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
          /* Copy the args if needed.  */
          for (param = DECL_ARGUMENTS (current_function_decl);
               param;
-              param = TREE_CHAIN (param))
+              param = DECL_CHAIN (param))
            if (arg_needs_copy_p (param))
              {
                tree name = gimple_default_def (cfun, param);