diff options
author | Richard Biener <rguenther@suse.de> | 2016-11-02 08:29:48 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-11-02 08:29:48 +0000 |
commit | da42ac7bc51006101e94711e6847f561d7b08005 (patch) | |
tree | e8b272d2021353490d87fd01f485f66e27320dc5 /gcc/tree-ssa-alias.c | |
parent | 3cea049a4fbfd0a81690d12d383d6a27246c98b7 (diff) | |
download | gcc-da42ac7bc51006101e94711e6847f561d7b08005.zip gcc-da42ac7bc51006101e94711e6847f561d7b08005.tar.gz gcc-da42ac7bc51006101e94711e6847f561d7b08005.tar.bz2 |
re PR tree-optimization/78035 (Inconsistency between address comparison and alias analysis)
2016-11-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/78035
PR tree-optimization/77964
* gimple-pretty-print.c (pp_points_to_solution): Print
vars_contains_interposable.
* tree-ssa-alias.c: Include varasm.h.
(ptrs_compare_unequal): Check vars_contains_interposable and
decl_binds_to_current_def_p.
(dump_points_to_solution): Dump vars_contains_interposable.
* tree-ssa-alias.h (struct pt_solution): Add vars_contains_interposable
flag.
* tree-ssa-structalias.c: Include varasm.h.
(set_uids_in_ptset): Record whether vars contains a
not decl_binds_to_current_def_p variable in vars_contains_interposable.
(ipa_escaped_pt): Update initializer.
* gcc.target/i386/pr78035.c: New testcase.
From-SVN: r241776
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 26c9f9e..ebae6cf 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -32,12 +32,12 @@ along with GCC; see the file COPYING3. If not see #include "tree-pretty-print.h" #include "alias.h" #include "fold-const.h" - #include "langhooks.h" #include "dumpfile.h" #include "tree-eh.h" #include "tree-dfa.h" #include "ipa-reference.h" +#include "varasm.h" /* Broad overview of how alias analysis on gimple works: @@ -373,14 +373,18 @@ ptrs_compare_unequal (tree ptr1, tree ptr2) /* We may not use restrict to optimize pointer comparisons. See PR71062. So we have to assume that restrict-pointed-to may be in fact obj1. */ - if (!pi || pi->pt.vars_contains_restrict) + if (!pi + || pi->pt.vars_contains_restrict + || pi->pt.vars_contains_interposable) return false; if (VAR_P (obj1) && (TREE_STATIC (obj1) || DECL_EXTERNAL (obj1))) { varpool_node *node = varpool_node::get (obj1); /* If obj1 may bind to NULL give up (see below). */ - if (! node || ! node->nonzero_address ()) + if (! node + || ! node->nonzero_address () + || ! decl_binds_to_current_def_p (obj1)) return false; } return !pt_solution_includes (&pi->pt, obj1); @@ -553,7 +557,12 @@ dump_points_to_solution (FILE *file, struct pt_solution *pt) comma = ", "; } if (pt->vars_contains_restrict) - fprintf (file, "%srestrict", comma); + { + fprintf (file, "%srestrict", comma); + comma = ", "; + } + if (pt->vars_contains_interposable) + fprintf (file, "%sinterposable", comma); fprintf (file, ")"); } } |