summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index a74f0834dfa..2a4ab2f4dc6 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -385,8 +385,7 @@ new_var_info (tree t, const char *name, bool add_id)
ret->is_global_var = (is_global_var (t)
/* We have to treat even local register variables
as escape points. */
- || (TREE_CODE (t) == VAR_DECL
- && DECL_HARD_REGISTER (t)));
+ || (VAR_P (t) && DECL_HARD_REGISTER (t)));
ret->solution = BITMAP_ALLOC (&pta_obstack);
ret->oldsolution = NULL;
ret->next = 0;
@@ -2929,8 +2928,7 @@ get_constraint_for_ssa_var (tree t, vec<ce_s> *results, bool address_p)
}
/* For global variables resort to the alias target. */
- if (TREE_CODE (t) == VAR_DECL
- && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
+ if (VAR_P (t) && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
varpool_node *node = varpool_node::get (t);
if (node && node->alias && node->analyzed)
@@ -6043,7 +6041,7 @@ create_variable_info_for (tree decl, const char *name, bool add_id)
insert_vi_for_tree (decl, vi);
- if (TREE_CODE (decl) != VAR_DECL)
+ if (!VAR_P (decl))
return id;
/* Create initial constraints for globals. */
@@ -6319,7 +6317,7 @@ set_uids_in_ptset (bitmap into, bitmap from, struct pt_solution *pt,
if (vi->is_restrict_var)
pt->vars_contains_restrict = true;
- if (TREE_CODE (vi->decl) == VAR_DECL
+ if (VAR_P (vi->decl)
|| TREE_CODE (vi->decl) == PARM_DECL
|| TREE_CODE (vi->decl) == RESULT_DECL)
{
@@ -7290,7 +7288,7 @@ visit_loadstore (gimple *, tree base, tree ref, void *data)
/* For plain decl accesses see whether they are accesses to globals
and rewrite them to MEM_REFs with { clique, 0 }. */
- if (TREE_CODE (base) == VAR_DECL
+ if (VAR_P (base)
&& is_global_var (base)
/* ??? We can't rewrite a plain decl with the walk_stmt_load_store
ops callback. */
@@ -7299,7 +7297,7 @@ visit_loadstore (gimple *, tree base, tree ref, void *data)
tree *basep = &ref;
while (handled_component_p (*basep))
basep = &TREE_OPERAND (*basep, 0);
- gcc_assert (TREE_CODE (*basep) == VAR_DECL);
+ gcc_assert (VAR_P (*basep));
tree ptr = build_fold_addr_expr (*basep);
tree zero = build_int_cst (TREE_TYPE (ptr), 0);
*basep = build2 (MEM_REF, TREE_TYPE (*basep), ptr, zero);