From: Jakub Jelinek Date: Fri, 14 Oct 2011 12:05:43 +0000 (+0200) Subject: gimple.c (walk_stmt_load_store_addr_ops): Call visit_addr also on COND_EXPR/VEC_COND_... X-Git-Tag: releases/gcc-4.7.0~3117 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9dd58aa41c1bde5bce9959c1453af4e790564073;p=thirdparty%2Fgcc.git gimple.c (walk_stmt_load_store_addr_ops): Call visit_addr also on COND_EXPR/VEC_COND_EXPR comparison operands if... * gimple.c (walk_stmt_load_store_addr_ops): Call visit_addr also on COND_EXPR/VEC_COND_EXPR comparison operands if they are ADDR_EXPRs. From-SVN: r179969 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9cfc339c2b3..c3bc276ce2ec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-10-14 Jakub Jelinek + + * gimple.c (walk_stmt_load_store_addr_ops): Call visit_addr + also on COND_EXPR/VEC_COND_EXPR comparison operands if they are + ADDR_EXPRs. + 2011-10-14 Richard Guenther PR tree-optimization/50723 diff --git a/gcc/gimple.c b/gcc/gimple.c index 19f02dc9cd17..b2874bb071bf 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -5313,9 +5313,24 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data, || gimple_code (stmt) == GIMPLE_COND)) { for (i = 0; i < gimple_num_ops (stmt); ++i) - if (gimple_op (stmt, i) - && TREE_CODE (gimple_op (stmt, i)) == ADDR_EXPR) - ret |= visit_addr (stmt, TREE_OPERAND (gimple_op (stmt, i), 0), data); + { + tree op = gimple_op (stmt, i); + if (op == NULL_TREE) + ; + else if (TREE_CODE (op) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); + /* COND_EXPR and VCOND_EXPR rhs1 argument is a comparison + tree with two operands. */ + else if (i == 1 && COMPARISON_CLASS_P (op)) + { + if (TREE_CODE (TREE_OPERAND (op, 0)) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (TREE_OPERAND (op, 0), + 0), data); + if (TREE_CODE (TREE_OPERAND (op, 1)) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (TREE_OPERAND (op, 1), + 0), data); + } + } } else if (is_gimple_call (stmt)) {