OSDN Git Service

2010-04-13 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Apr 2010 09:53:19 +0000 (09:53 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:32:00 +0000 (14:32 +0900)
* tree-ssa-structalias.c (callused_id): Remove.
(call_stmt_vars): New.
(get_call_vi): Likewise.
(lookup_call_use_vi): Likewise.
(lookup_call_clobber_vi): Likewise.
(get_call_use_vi): Likewise.
(get_call_clobber_vi): Likewise.
(make_transitive_closure_constraints): Likewise.
(handle_const_call): Adjust to do per-call call-used handling.
(handle_pure_call): Likewise.
(find_what_var_points_to): Remove general callused handling.
(init_base_vars): Likewise.
(init_alias_vars): Initialize call_stmt_vars.
(compute_points_to_sets): Process call-used and call-clobbered
vars for call statements.
(delete_points_to_sets): Free call_stmt_vars.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158260 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-structalias.c

index 510b291..24b2288 100644 (file)
@@ -1,5 +1,24 @@
 2010-04-13  Richard Guenther  <rguenther@suse.de>
 
 2010-04-13  Richard Guenther  <rguenther@suse.de>
 
+       * tree-ssa-structalias.c (callused_id): Remove.
+       (call_stmt_vars): New.
+       (get_call_vi): Likewise.
+       (lookup_call_use_vi): Likewise.
+       (lookup_call_clobber_vi): Likewise.
+       (get_call_use_vi): Likewise.
+       (get_call_clobber_vi): Likewise.
+       (make_transitive_closure_constraints): Likewise.
+       (handle_const_call): Adjust to do per-call call-used handling.
+       (handle_pure_call): Likewise.
+       (find_what_var_points_to): Remove general callused handling.
+       (init_base_vars): Likewise.
+       (init_alias_vars): Initialize call_stmt_vars.
+       (compute_points_to_sets): Process call-used and call-clobbered
+       vars for call statements.
+       (delete_points_to_sets): Free call_stmt_vars.
+
+2010-04-13  Richard Guenther  <rguenther@suse.de>
+
        * tree-vect-data-refs.c (vect_analyze_data_ref_dependence):
        Only add RW dependence for dependence distance zero.
        Adjust maximal vectorization factor according to dependences.
        * tree-vect-data-refs.c (vect_analyze_data_ref_dependence):
        Only add RW dependence for dependence distance zero.
        Adjust maximal vectorization factor according to dependences.
index a065e64..c1ce673 100644 (file)
@@ -3599,8 +3599,8 @@ make_transitive_closure_constraints (varinfo_t vi)
   process_constraint (new_constraint (lhs, rhs));
 }
 
   process_constraint (new_constraint (lhs, rhs));
 }
 
-/* Create a new artificial heap variable with NAME.
-   Return the created variable.  */
+/* Create a new artificial heap variable with NAME and make a
+   constraint from it to LHS.  Return the created variable.  */
 
 static varinfo_t
 make_heapvar_for (varinfo_t lhs, const char *name)
 
 static varinfo_t
 make_heapvar_for (varinfo_t lhs, const char *name)
@@ -5660,12 +5660,7 @@ find_what_var_points_to (varinfo_t orig_vi, struct pt_solution *pt)
          if (vi->id == nothing_id)
            pt->null = 1;
          else if (vi->id == escaped_id)
          if (vi->id == nothing_id)
            pt->null = 1;
          else if (vi->id == escaped_id)
-           {
-             if (in_ipa_mode)
-               pt->ipa_escaped = 1;
-             else
-               pt->escaped = 1;
-           }
+           pt->escaped = 1;
          else if (vi->id == nonlocal_id)
            pt->nonlocal = 1;
          else if (vi->is_heap_var)
          else if (vi->id == nonlocal_id)
            pt->nonlocal = 1;
          else if (vi->is_heap_var)
@@ -6366,7 +6361,6 @@ compute_points_to_sets (void)
   basic_block bb;
   unsigned i;
   varinfo_t vi;
   basic_block bb;
   unsigned i;
   varinfo_t vi;
-  struct pt_solution callused;
 
   timevar_push (TV_TREE_PTA);
 
 
   timevar_push (TV_TREE_PTA);
 
@@ -6408,7 +6402,6 @@ compute_points_to_sets (void)
   /* Compute the points-to set for ESCAPED used for call-clobber analysis.  */
   find_what_var_points_to (get_varinfo (escaped_id),
                           &cfun->gimple_df->escaped);
   /* Compute the points-to set for ESCAPED used for call-clobber analysis.  */
   find_what_var_points_to (get_varinfo (escaped_id),
                           &cfun->gimple_df->escaped);
-  find_what_var_points_to (get_varinfo (callused_id), &callused);
 
   /* Make sure the ESCAPED solution (which is used as placeholder in
      other solutions) does not reference itself.  This simplifies
 
   /* Make sure the ESCAPED solution (which is used as placeholder in
      other solutions) does not reference itself.  This simplifies
@@ -6447,11 +6440,11 @@ compute_points_to_sets (void)
          pt = gimple_call_use_set (stmt);
          if (gimple_call_flags (stmt) & ECF_CONST)
            memset (pt, 0, sizeof (struct pt_solution));
          pt = gimple_call_use_set (stmt);
          if (gimple_call_flags (stmt) & ECF_CONST)
            memset (pt, 0, sizeof (struct pt_solution));
-         else if (gimple_call_flags (stmt) & ECF_PURE)
+         else if ((vi = lookup_call_use_vi (stmt)) != NULL)
            {
            {
-             /* For const calls we should now be able to compute the
-                call-used set per function.  */
-             *pt = callused;
+             find_what_var_points_to (vi, pt);
+             /* Escaped (and thus nonlocal) variables are always
+                implicitly used by calls.  */
              /* ???  ESCAPED can be empty even though NONLOCAL
                 always escaped.  */
              pt->nonlocal = 1;
              /* ???  ESCAPED can be empty even though NONLOCAL
                 always escaped.  */
              pt->nonlocal = 1;
@@ -6459,6 +6452,8 @@ compute_points_to_sets (void)
            }
          else
            {
            }
          else
            {
+             /* If there is nothing special about this call then
+                we have made everything that is used also escape.  */
              *pt = cfun->gimple_df->escaped;
              pt->nonlocal = 1;
            }
              *pt = cfun->gimple_df->escaped;
              pt->nonlocal = 1;
            }