From bc8800eb933ceb313ec395ddded7c222fd46c3ed Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 11 Mar 2008 12:17:21 +0000 Subject: [PATCH] find_address_taken_state() handle CopyB like a set of Loads/Stores that do NOT take the address if no hidden conversion happens [r18058] --- ir/ana/irmemory.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ir/ana/irmemory.c b/ir/ana/irmemory.c index c90a352ab..6bf95bdc8 100644 --- a/ir/ana/irmemory.c +++ b/ir/ana/irmemory.c @@ -772,10 +772,11 @@ static int is_hidden_cast(ir_mode *mode, ir_mode *ent_mode) { * @param irn the node */ static ir_address_taken_state find_address_taken_state(ir_node *irn) { - int i, j; - ir_mode *emode, *mode; - ir_node *value; + int i, j; + ir_mode *emode, *mode; + ir_node *value; ir_entity *ent; + ir_type *tp; for (i = get_irn_n_outs(irn) - 1; i >= 0; --i) { ir_node *succ = get_irn_out(irn, i); @@ -803,6 +804,16 @@ static ir_address_taken_state find_address_taken_state(ir_node *irn) { return ir_address_taken; break; + case iro_CopyB: + /* CopyB are like Loads/Stores */ + ent = is_SymConst(irn) ? get_SymConst_entity(irn) : get_Sel_entity(irn); + tp = get_entity_type(ent); + if (tp != get_CopyB_type(succ)) { + /* bad, different types, might be a hidden conversion */ + return ir_address_taken; + } + break; + case iro_Sel: { /* Check the successor of irn. */ ir_address_taken_state res = find_address_taken_state(succ); -- 2.20.1