diff options
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 352dc9e..ceb18ba 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1469,9 +1469,7 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags, if (MTAG_P (var)) aliases = MTAG_ALIASES (var); - if (aliases == NULL - /* ??? We should not have created an empty aliases bitmap. */ - || bitmap_empty_p (aliases)) + if (aliases == NULL) { if (!gimple_aliases_computed_p (cfun) && (flags & opf_def)) @@ -1485,16 +1483,18 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags, } else { - referenced_var_iterator ri; + bitmap_iterator bi; + unsigned int i; bool none_added = true; - tree al; /* The variable is aliased. Add its aliases to the virtual operands. */ gcc_assert (!bitmap_empty_p (aliases)); - FOR_EACH_REFERENCED_VAR_IN_BITMAP (aliases, al, ri) + EXECUTE_IF_SET_IN_BITMAP (aliases, 0, i, bi) { + tree al = referenced_var (i); + /* For SFTs we have to consider all subvariables of the parent var if it is a potential points-to location. */ if (TREE_CODE (al) == STRUCT_FIELD_TAG @@ -1779,10 +1779,10 @@ get_tmr_operands (tree stmt, tree expr, int flags) static void add_call_clobber_ops (tree stmt, tree callee) { - referenced_var_iterator ri; + unsigned u; + bitmap_iterator bi; stmt_ann_t s_ann = stmt_ann (stmt); bitmap not_read_b, not_written_b; - tree var; /* If we created .GLOBAL_VAR earlier, just use it. */ if (gimple_global_var (cfun)) @@ -1796,18 +1796,17 @@ add_call_clobber_ops (tree stmt, tree callee) set for each static if the call being processed does not read or write that variable. */ not_read_b = callee ? ipa_reference_get_not_read_global (callee) : NULL; - not_written_b = callee ? ipa_reference_get_not_written_global (callee) : NULL; + not_written_b = callee ? ipa_reference_get_not_written_global (callee) : NULL; /* Add a VDEF operand for every call clobbered variable. */ - FOR_EACH_REFERENCED_VAR_IN_BITMAP (gimple_call_clobbered_vars (cfun), var, ri) + EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, u, bi) { - unsigned int escape_mask; + tree var = referenced_var_lookup (u); + unsigned int escape_mask = var_ann (var)->escape_mask; tree real_var = var; bool not_read; bool not_written; - - escape_mask = var_ann (var)->escape_mask; - + /* Not read and not written are computed on regular vars, not subvars, so look at the parent var if this is an SFT. */ if (TREE_CODE (var) == STRUCT_FIELD_TAG) @@ -1864,10 +1863,10 @@ add_call_clobber_ops (tree stmt, tree callee) static void add_call_read_ops (tree stmt, tree callee) { - referenced_var_iterator ri; + unsigned u; + bitmap_iterator bi; stmt_ann_t s_ann = stmt_ann (stmt); bitmap not_read_b; - tree var; /* if the function is not pure, it may reference memory. Add a VUSE for .GLOBAL_VAR if it has been created. See add_referenced_var @@ -1882,11 +1881,12 @@ add_call_read_ops (tree stmt, tree callee) not_read_b = callee ? ipa_reference_get_not_read_global (callee) : NULL; /* Add a VUSE for each call-clobbered variable. */ - FOR_EACH_REFERENCED_VAR_IN_BITMAP (gimple_call_clobbered_vars (cfun), var, ri) + EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, u, bi) { + tree var = referenced_var (u); tree real_var = var; bool not_read; - + clobber_stats.readonly_clobbers++; /* Not read and not written are computed on regular vars, not @@ -2008,18 +2008,21 @@ get_asm_expr_operands (tree stmt) for (link = ASM_CLOBBERS (stmt); link; link = TREE_CHAIN (link)) if (strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory") == 0) { - referenced_var_iterator ri; - tree var; + unsigned i; + bitmap_iterator bi; s_ann->references_memory = true; - FOR_EACH_REFERENCED_VAR_IN_BITMAP (gimple_call_clobbered_vars (cfun), - var, ri) - add_stmt_operand (&var, s_ann, opf_def | opf_implicit); + EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, i, bi) + { + tree var = referenced_var (i); + add_stmt_operand (&var, s_ann, opf_def | opf_implicit); + } - FOR_EACH_REFERENCED_VAR_IN_BITMAP (gimple_addressable_vars (cfun), - var, ri) + EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), 0, i, bi) { + tree var = referenced_var (i); + /* Subvars are explicitly represented in this list, so we don't need the original to be added to the clobber ops, but the original *will* be in this list because we keep |