Hi,

I've ported two recent commits in make_restrict_var_constraints tree-ssa-structalias.c on trunk to gomp-4_0-branch.

Committed as attached to gomp-4_0-branch.

Thanks,
- Tom
Backport make_restrict_var_constraints fixes from trunk

2015-11-03  Tom de Vries  <t...@codesourcery.com>

	backport from trunk:
	2015-11-03  Tom de Vries  <t...@codesourcery.com>

	* tree-ssa-structalias.c (make_restrict_var_constraints): Rename to ...
	(make_param_constraints): ... this.  Add and handle restrict_name
	parameter.  Handle is_full_var case.
	(intra_create_variable_infos): Use make_param_constraints.

	* tree-ssa-structalias.c (make_restrict_var_constraints): Replace
	make_copy_constraint call with make_constraint_from call.
---
 gcc/ChangeLog              | 12 ++++++++++++
 gcc/tree-ssa-structalias.c | 33 ++++++++++++++-------------------
 2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 70895a6..b28bf54 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2015-11-03  Tom de Vries  <t...@codesourcery.com>
+
+	* tree-ssa-structalias.c (make_restrict_var_constraints): Rename to ...
+	(make_param_constraints): ... this.  Add and handle restrict_name
+	parameter.  Handle is_full_var case.
+	(intra_create_variable_infos): Use make_param_constraints.
+
+2015-11-03  Tom de Vries  <t...@codesourcery.com>
+
+	* tree-ssa-structalias.c (make_restrict_var_constraints): Replace
+	make_copy_constraint call with make_constraint_from call.
+
 2015-08-29  Anatoly Sokolov  <ae...@post.ru>
 
 	* config/mcore/mcore.h (REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P,
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index d409727..f4c875f 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5892,19 +5892,22 @@ debug_solution_for_var (unsigned int var)
   dump_solution_for_var (stderr, var);
 }
 
-/* Register the constraints for restrict var VI.  */
+/* Register the constraints for function parameter related VI.  Use RESTRICT_NAME
+   as the base name of created restrict vars.  */
 
 static void
-make_restrict_var_constraints (varinfo_t vi)
+make_param_constraints (varinfo_t vi, const char *restrict_name)
 {
   for (; vi; vi = vi_next (vi))
-    if (vi->may_have_pointers)
-      {
-	if (vi->only_restrict_pointers)
-	  make_constraint_from_global_restrict (vi, "GLOBAL_RESTRICT", true);
-	else
-	  make_copy_constraint (vi, nonlocal_id);
-      }
+    {
+      if (vi->only_restrict_pointers)
+	make_constraint_from_global_restrict (vi, restrict_name, true);
+      else if (vi->may_have_pointers)
+	make_constraint_from (vi, nonlocal_id);
+
+      if (vi->is_full_var)
+	break;
+    }
 }
 
 /* Create varinfo structures for all of the variables in the
@@ -5941,19 +5944,11 @@ intra_create_variable_infos (struct function *fn)
 	  vi->is_restrict_var = 1;
 	  insert_vi_for_tree (heapvar, vi);
 	  make_constraint_from (p, vi->id);
-	  make_restrict_var_constraints (vi);
+	  make_param_constraints (vi, "GLOBAL_RESTRICT");
 	  continue;
 	}
 
-      for (; p; p = vi_next (p))
-	{
-	  if (p->only_restrict_pointers)
-	    make_constraint_from_global_restrict (p, "PARM_RESTRICT", true);
-	  else if (p->may_have_pointers)
-	    make_constraint_from (p, nonlocal_id);
-	  if (p->is_full_var)
-	    break;
-	}
+      make_param_constraints (p, "PARM_RESTRICT");
     }
 
   /* Add a constraint for a result decl that is passed by reference.  */
-- 
1.9.1

Reply via email to