diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-16 13:23:13 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-16 13:23:13 +0000 |
commit | 6d5ec6f8d3a4782393733d95b0d52a688568bdf5 (patch) | |
tree | b4ca92d1770ab1befed804ce5ea55e6305e8bc39 /gcc/tree-ssa-operands.c | |
parent | 5ed0b345190566f64eebc1af871f5282aaa0bd97 (diff) | |
download | gcc-6d5ec6f8d3a4782393733d95b0d52a688568bdf5.tar.gz |
2009-04-16 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_copy): Do not clear addresses_taken bitmap.
(gimple_ior_addresses_taken_1): New function.
(gimple_ior_addresses_taken): Likewise.
* gimple.h (struct gimple_statement_with_ops_base): Remove
addresses_taken member.
(gimple_ior_addresses_taken): Declare.
(gimple_addresses_taken, gimple_addresses_taken_ptr,
gimple_set_addresses_taken): Remove.
* ipa-reference.c (mark_address): New function.
(scan_stmt_for_static_refs): Use it for marking addresses taken.
* tree-ssa-operands.c (add_to_addressable_set): Rename to ...
(mark_address_taken): ... this. Just set TREE_ADDRESSABLE.
(gimple_add_to_addresses_taken): Remove.
(get_tmr_operands): Call mark_address_taken.
(get_asm_expr_operands): Likewise.
(get_expr_operands): Likewise.
(build_ssa_operands): Do not clear the addresses_taken bitmap.
(free_stmt_operands): Do not free it.
* tree-ssa.c (delete_tree_ssa): Likewise.
(execute_update_addresses_taken): Use gimple_ior_addresses_taken.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146191 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index c9473a8f9b1..7d588f8eb96 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -686,10 +686,13 @@ add_stmt_operand (tree *var_p, gimple stmt, int flags) add_virtual_operand (stmt, flags); } -/* Add the base address of REF to SET. */ +/* Mark the base address of REF as having its address taken. + REF may be a single variable whose address has been taken or any + other valid GIMPLE memory reference (structure reference, array, + etc). */ static void -add_to_addressable_set (tree ref, bitmap *set) +mark_address_taken (tree ref) { tree var; @@ -699,27 +702,8 @@ add_to_addressable_set (tree ref, bitmap *set) be referenced using pointer arithmetic. See PR 21407 and the ensuing mailing list discussion. */ var = get_base_address (ref); - if (var && SSA_VAR_P (var)) - { - if (*set == NULL) - *set = BITMAP_ALLOC (&operands_bitmap_obstack); - - bitmap_set_bit (*set, DECL_UID (var)); - TREE_ADDRESSABLE (var) = 1; - } -} - -/* Add the base address of REF to the set of addresses taken by STMT. - REF may be a single variable whose address has been taken or any - other valid GIMPLE memory reference (structure reference, array, - etc). If the base address of REF is a decl that has sub-variables, - also add all of its sub-variables. */ - -static void -gimple_add_to_addresses_taken (gimple stmt, tree ref) -{ - gcc_assert (gimple_has_ops (stmt)); - add_to_addressable_set (ref, gimple_addresses_taken_ptr (stmt)); + if (var && DECL_P (var)) + TREE_ADDRESSABLE (var) = 1; } @@ -763,7 +747,7 @@ get_tmr_operands (gimple stmt, tree expr, int flags) get_expr_operands (stmt, &TMR_INDEX (expr), opf_use); if (TMR_SYMBOL (expr)) - gimple_add_to_addresses_taken (stmt, TMR_SYMBOL (expr)); + mark_address_taken (TMR_SYMBOL (expr)); add_virtual_operand (stmt, flags); } @@ -824,7 +808,7 @@ get_asm_expr_operands (gimple stmt) { tree t = get_base_address (TREE_VALUE (link)); if (t && DECL_P (t)) - gimple_add_to_addresses_taken (stmt, t); + mark_address_taken (t); } get_expr_operands (stmt, &TREE_VALUE (link), opf_def); @@ -844,7 +828,7 @@ get_asm_expr_operands (gimple stmt) { tree t = get_base_address (TREE_VALUE (link)); if (t && DECL_P (t)) - gimple_add_to_addresses_taken (stmt, t); + mark_address_taken (t); } get_expr_operands (stmt, &TREE_VALUE (link), 0); @@ -887,7 +871,7 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags) reference to it, but the fact that the statement takes its address will be of interest to some passes (e.g. alias resolution). */ - gimple_add_to_addresses_taken (stmt, TREE_OPERAND (expr, 0)); + mark_address_taken (TREE_OPERAND (expr, 0)); /* If the address is invariant, there may be no interesting variable references inside. */ @@ -1091,14 +1075,9 @@ parse_ssa_operands (gimple stmt) static void build_ssa_operands (gimple stmt) { - /* Initially assume that the statement has no volatile operands and - makes no memory references. */ + /* Initially assume that the statement has no volatile operands. */ gimple_set_has_volatile_ops (stmt, false); - /* Just clear the bitmap so we don't end up reallocating it over and over. */ - if (gimple_addresses_taken (stmt)) - bitmap_clear (gimple_addresses_taken (stmt)); - start_ssa_stmt_operands (); parse_ssa_operands (stmt); finalize_ssa_stmt_operands (stmt); @@ -1133,9 +1112,6 @@ free_stmt_operands (gimple stmt) gimple_set_use_ops (stmt, NULL); } - if (gimple_has_ops (stmt)) - gimple_set_addresses_taken (stmt, NULL); - if (gimple_has_mem_ops (stmt)) { gimple_set_vuse (stmt, NULL_TREE); |