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

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
This commit is contained in:
Richard Biener 2015-09-23 11:11:48 +00:00 committed by Richard Biener
parent 40f1d2ab26
commit be6e26f995
4 changed files with 16 additions and 8 deletions

View 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.

View 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.

View 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];
}

View 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;