From: Tom de Vries Date: Tue, 22 Sep 2015 14:14:56 +0000 (+0000) Subject: Handle restrict pointer references as restrict in AA X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8013b816cc8b2de17db1a5115f4df482f0acbc6d;p=gcc.git Handle restrict pointer references as restrict in AA 2015-09-22 Tom de Vries PR tree-optimization/67671 * tree-ssa-structalias.c (create_variable_info_for_1): Handle restrict pointer references as restrict. * g++.dg/pr67671.C: New test. From-SVN: r228015 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7eb8b6dbf7f..95db04796a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-09-22 Tom de Vries + + PR tree-optimization/67671 + * tree-ssa-structalias.c (create_variable_info_for_1): Handle restrict + pointer references as restrict. + 2015-09-22 Chung-Lin Tang * config/nios2/nios2.c (nios2_legitimize_address): When handling diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9c9bc5a44e4..bcd04a03bd3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-09-22 Tom de Vries + + PR tree-optimization/67671 + * g++.dg/pr67671.C: New test. + 2015-09-22 Alexander Fomin PR target/67480 diff --git a/gcc/testsuite/g++.dg/pr67671.C b/gcc/testsuite/g++.dg/pr67671.C new file mode 100644 index 00000000000..952ea4f0898 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr67671.C @@ -0,0 +1,12 @@ +// { dg-do compile } +// { dg-options "-O2 -fdump-tree-ealias-all" } + +void +f (int *__restrict__ &__restrict__ p) +{ + *p = 1; +} + +// { dg-final { scan-tree-dump-times "clique 1 base 1" 1 "ealias" } } +// { dg-final { scan-tree-dump-times "clique 1 base 2" 1 "ealias" } } +// { dg-final { scan-tree-dump-times "(?n)clique .* base .*" 2 "ealias" } } diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 66772cdfd5f..1767b0435d7 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -5684,6 +5684,9 @@ create_variable_info_for_1 (tree decl, const char *name) vi->fullsize = tree_to_uhwi (declsize); vi->size = vi->fullsize; vi->is_full_var = true; + if (POINTER_TYPE_P (TREE_TYPE (decl)) + && TYPE_RESTRICT (TREE_TYPE (decl))) + vi->only_restrict_pointers = 1; fieldstack.release (); return vi; }