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/gimple.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/gimple.c')
-rw-r--r-- | gcc/gimple.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 29692782aed..a91e83a99d4 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -2195,16 +2195,11 @@ gimple_copy (gimple stmt) for (i = 0; i < num_ops; i++) gimple_set_op (copy, i, unshare_expr (gimple_op (stmt, i))); - /* Clear out SSA operand vectors on COPY. Note that we cannot - call the API functions for setting addresses_taken, stores - and loads. These functions free the previous values, and we - cannot do that on COPY as it will affect the original - statement. */ + /* Clear out SSA operand vectors on COPY. */ if (gimple_has_ops (stmt)) { gimple_set_def_ops (copy, NULL); gimple_set_use_ops (copy, NULL); - copy->gsops.opbase.addresses_taken = NULL; } if (gimple_has_mem_ops (stmt)) @@ -3392,4 +3387,32 @@ walk_stmt_load_store_ops (gimple stmt, void *data, visit_load, visit_store, NULL); } +/* Helper for gimple_ior_addresses_taken_1. */ + +static bool +gimple_ior_addresses_taken_1 (gimple stmt ATTRIBUTE_UNUSED, + tree addr, void *data) +{ + bitmap addresses_taken = (bitmap)data; + while (handled_component_p (addr)) + addr = TREE_OPERAND (addr, 0); + if (DECL_P (addr)) + { + bitmap_set_bit (addresses_taken, DECL_UID (addr)); + return true; + } + return false; +} + +/* Set the bit for the uid of all decls that have their address taken + in STMT in the ADDRESSES_TAKEN bitmap. Returns true if there + were any in this stmt. */ + +bool +gimple_ior_addresses_taken (bitmap addresses_taken, gimple stmt) +{ + return walk_stmt_load_store_addr_ops (stmt, addresses_taken, NULL, NULL, + gimple_ior_addresses_taken_1); +} + #include "gt-gimple.h" |