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 0cc98c7febd64165d8e5602061765ed344704278..c46bd6d26a73caa86f3cf75871164c138ce0e6ac 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 404b84cb0d6dc63108441f90680d66e6f1726f3c..36e30b6056ee9e0f161091164d2529da6f98b326 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 e2be0df12e5e8e8038f67e0b49d1b310678a8b06..4f97360dc720fd16be14b03e65ed5b6a34fb4ad6 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 1767b0435d72770174495eaeaa542a50f2e1faee..8d81bd4f730525a1ffe7a195916d0c80d784db8a 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;