summaryrefslogtreecommitdiff
path: root/gcc/ipa-reference.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-13 19:12:39 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-13 19:12:39 +0000
commit2e1c3fd67df953391a30be47242cd405e0c01599 (patch)
tree8446575dc0c1e9a3e001053e272f3a83237449b0 /gcc/ipa-reference.c
parent4cc1b222090db464949e512938f2f8627f17fc72 (diff)
downloadgcc-2e1c3fd67df953391a30be47242cd405e0c01599.tar.gz
* ipa-reference.c (analyze_function): Consider also addresses taken
in phi nodes. * gcc.dg/20070112-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120757 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r--gcc/ipa-reference.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index 8602afda0b0..b1ff849082e 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -807,6 +807,21 @@ analyze_function (struct cgraph_node *fn)
FOR_EACH_BB_FN (this_block, this_cfun)
{
block_stmt_iterator bsi;
+ tree phi, op;
+ use_operand_p use;
+ ssa_op_iter iter;
+
+ /* Find the addresses taken in phi node arguments. */
+ for (phi = phi_nodes (this_block); phi; phi = PHI_CHAIN (phi))
+ {
+ FOR_EACH_PHI_ARG (use, phi, iter, SSA_OP_USE)
+ {
+ op = USE_FROM_PTR (use);
+ if (TREE_CODE (op) == ADDR_EXPR)
+ check_rhs_var (l, op);
+ }
+ }
+
for (bsi = bsi_start (this_block); !bsi_end_p (bsi); bsi_next (&bsi))
walk_tree (bsi_stmt_ptr (bsi), scan_for_static_refs,
fn, visited_nodes);