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-structalias.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-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index a0110bc..2880382 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -39,6 +39,8 @@ #include "tree-dfa.h" #include "params.h" #include "gimple-walk.h" +#include "varasm.h" + /* The idea behind this analyzer is to generate set constraints from the program, then solve the resulting constraints in order to generate the @@ -6360,6 +6362,13 @@ set_uids_in_ptset (bitmap into, bitmap from, struct pt_solution *pt, && fndecl && ! auto_var_in_fn_p (vi->decl, fndecl))) pt->vars_contains_nonlocal = true; + + /* If we have a variable that is interposable record that fact + for pointer comparison simplification. */ + if (VAR_P (vi->decl) + && (TREE_STATIC (vi->decl) || DECL_EXTERNAL (vi->decl)) + && ! decl_binds_to_current_def_p (vi->decl)) + pt->vars_contains_interposable = true; } else if (TREE_CODE (vi->decl) == FUNCTION_DECL @@ -7592,7 +7601,8 @@ make_pass_build_ealias (gcc::context *ctxt) /* IPA PTA solutions for ESCAPED. */ struct pt_solution ipa_escaped_pt - = { true, false, false, false, false, false, false, false, false, NULL }; + = { true, false, false, false, false, + false, false, false, false, false, NULL }; /* Associate node with varinfo DATA. Worker for cgraph_for_symbol_thunks_and_aliases. */ |