tree-ssa-structalias.c (intra_create_variable_infos): Build representatives for all...
authorRichard Biener <rguenther@suse.de>
Wed, 23 Sep 2015 11:11:48 +0000 (11:11 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 23 Sep 2015 11:11:48 +0000 (11:11 +0000)
2015-09-23  Richard Biener  <rguenther@suse.de>

* tree-ssa-structalias.c (intra_create_variable_infos): Build
representatives for all restrict qualified pointer destinations.

* g++.dg/tree-ssa/restrict2.C: Un-XFAIL testcase.

From-SVN: r228040

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/restrict2.C
gcc/tree-ssa-structalias.c

index 0cc98c7..c46bd6d 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-23  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-structalias.c (intra_create_variable_infos): Build
+       representatives for all restrict qualified pointer destinations.
+
 2015-09-23  Kirill Yukhin  <kirill.yukhin@intel.com>
 
        * config/i386/i386.md (define_code_attr mshift): New.
index 404b84c..36e30b6 100644 (file)
@@ -1,3 +1,7 @@
+2015-09-23  Richard Biener  <rguenther@suse.de>
+
+       * g++.dg/tree-ssa/restrict2.C: Un-XFAIL testcase.
+
 2015-09-22  Patrick Palka  <ppalka@gcc.gnu.org>
 
        * c-c++-common/Wmisleading-indentation.c: Augment test.
index e2be0df..4f97360 100644 (file)
@@ -45,8 +45,7 @@ f5 (S *__restrict x, S *__restrict y)
 {
   x->p[0] = 5;
   y->p[0] = 0;
-// We might handle this some day
-// { dg-final { scan-tree-dump-times "return 5" 1 "optimized" { xfail *-*-* } } }
+// { dg-final { scan-tree-dump-times "return 5" 1 "optimized" } }
   return x->p[0];
 }
 
index 1767b04..8d81bd4 100644 (file)
@@ -5857,12 +5857,12 @@ intra_create_variable_infos (struct function *fn)
     {
       varinfo_t p = get_vi_for_tree (t);
 
-      /* For restrict qualified pointers to objects passed by
-         reference build a real representative for the pointed-to object.
-        Treat restrict qualified references the same.  */
-      if (TYPE_RESTRICT (TREE_TYPE (t))
-         && ((DECL_BY_REFERENCE (t) && POINTER_TYPE_P (TREE_TYPE (t)))
-             || TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE)
+      /* For restrict qualified pointers build a representative for
+        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))))
        {
          struct constraint_expr lhsc, rhsc;