Add vars in intra_create_variables_info
authorTom de Vries <tom@codesourcery.com>
Mon, 26 Oct 2015 10:47:00 +0000 (10:47 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Mon, 26 Oct 2015 10:47:00 +0000 (10:47 +0000)
2015-10-26  Tom de Vries  <tom@codesourcery.com>

* tree-ssa-structalias.c (intra_create_variable_infos): Add
restrict_pointer_p and recursive_restrict_p variables.

From-SVN: r229323

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

index 9b9ddd71192f40edf345d4458c209b09e566435a..e4a8b88981c42445dd78878b8f3934360e2cd289 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-26  Tom de Vries  <tom@codesourcery.com>
+
+       * tree-ssa-structalias.c (intra_create_variable_infos): Add
+       restrict_pointer_p and recursive_restrict_p variables.
+
 2015-10-26  Tom de Vries  <tom@codesourcery.com>
 
        * tree-ssa-structalias.c (intra_create_variable_infos): Inline
index c5a7e2a3be562c41fa5aa0de5f1d7f8aa7ac5a07..1e1ae95a297ed80c5304aeeb6677035cb01ac162 100644 (file)
@@ -5857,6 +5857,11 @@ intra_create_variable_infos (struct function *fn)
      passed-by-reference argument.  */
   for (t = DECL_ARGUMENTS (fn->decl); t; t = DECL_CHAIN (t))
     {
+      bool restrict_pointer_p = (POINTER_TYPE_P (TREE_TYPE (t))
+                                && TYPE_RESTRICT (TREE_TYPE (t)));
+      bool recursive_restrict_p
+       = (restrict_pointer_p
+          && !type_contains_placeholder_p (TREE_TYPE (TREE_TYPE (t))));
       varinfo_t p = lookup_vi_for_tree (t);
       if (p == NULL)
        {
@@ -5868,9 +5873,7 @@ intra_create_variable_infos (struct function *fn)
         the pointed-to object.  Note that this ends up handling
         out-of-bound references conservatively by aggregating them
         in the first/last subfield of the object.  */
-      if (POINTER_TYPE_P (TREE_TYPE (t))
-         && TYPE_RESTRICT (TREE_TYPE (t))
-         && !type_contains_placeholder_p (TREE_TYPE (TREE_TYPE (t))))
+      if (recursive_restrict_p)
        {
          varinfo_t vi;
          tree heapvar = build_fake_var_decl (TREE_TYPE (TREE_TYPE (t)));
@@ -5890,8 +5893,7 @@ intra_create_variable_infos (struct function *fn)
          continue;
        }
 
-      if (POINTER_TYPE_P (TREE_TYPE (t))
-         && TYPE_RESTRICT (TREE_TYPE (t)))
+      if (restrict_pointer_p)
        make_constraint_from_global_restrict (p, "PARM_RESTRICT");
       else
        {