diff options
author | Richard Biener <rguenther@suse.de> | 2016-10-20 14:14:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-10-20 14:14:47 +0000 |
commit | 40b8428e2e586d89cce4fbafb8ef333a062a53f8 (patch) | |
tree | 76741cf91c5b716dba2283f07c3d8dcba3801b64 /gcc/tree-ssa-structalias.c | |
parent | eff89e01b880e6f058ae136935d70c743bc852b6 (diff) | |
download | gcc-40b8428e2e586d89cce4fbafb8ef333a062a53f8.zip gcc-40b8428e2e586d89cce4fbafb8ef333a062a53f8.tar.gz gcc-40b8428e2e586d89cce4fbafb8ef333a062a53f8.tar.bz2 |
tree-ssa-alias.c (ptrs_compare_unequal): Remove code duplication.
2016-10-20 Richard Biener <rguenther@suse.de>
* tree-ssa-alias.c (ptrs_compare_unequal): Remove code duplication.
Handle decls possibly not bound.
* tree-ssa-structalias.c (get_constraint_for_ssa_var): Add
nothing_id for decls that might not be bound if we are interested
for the address.
(get_constraint_for_component_ref): Deal with that.
From-SVN: r241378
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 78f4533..fb364f1 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2944,6 +2944,16 @@ get_constraint_for_ssa_var (tree t, vec<ce_s> *results, bool address_p) DECL_PT_UID (t) = DECL_UID (node->decl); t = node->decl; } + + /* If this is decl may bind to NULL note that. */ + if (address_p + && (! node || ! node->nonzero_address ())) + { + cexpr.var = nothing_id; + cexpr.type = SCALAR; + cexpr.offset = 0; + results->safe_push (cexpr); + } } vi = get_vi_for_tree (t); @@ -3213,6 +3223,12 @@ get_constraint_for_component_ref (tree t, vec<ce_s> *results, /* Pretend to take the address of the base, we'll take care of adding the required subset of sub-fields below. */ get_constraint_for_1 (t, results, true, lhs_p); + /* Strip off nothing_id. */ + if (results->length () == 2) + { + gcc_assert ((*results)[0].var == nothing_id); + results->unordered_remove (0); + } gcc_assert (results->length () == 1); struct constraint_expr &result = results->last (); |