+2013-12-02 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-operands.c (opf_implicit): Remove.
+ (opf_address_taken): New flag.
+ (get_expr_operands): Remove early out, pass down
+ opf_address_taken for ADDR_EXPRs, add a use operand only
+ for non-opf_address_taken bases.
+ (get_indirect_ref_operands): Rename to ...
+ (get_mem_ref_operands): ... this.
+ (get_asm_expr_operands): Rename to ...
+ (get_asm_stmt_operands): ... this.
+
2013-12-02 Yuri Rumyantsev <ysrumyan@gmail.com>
* ipa-inline.c (check_callers): Add missed pointer de-reference.
VUSE for 'b'. */
#define opf_no_vops (1 << 1)
-/* Operand is an implicit reference. This is used to distinguish
- explicit assignments in the form of MODIFY_EXPR from
- clobbering sites like function calls or ASM_EXPRs. */
-#define opf_implicit (1 << 2)
-
/* Operand is in a place where address-taken does not imply addressable. */
#define opf_non_addressable (1 << 3)
/* Operand is in a place where opf_non_addressable does not apply. */
#define opf_not_non_addressable (1 << 4)
+/* Operand is having its address taken. */
+#define opf_address_taken (1 << 5)
+
/* Array for building all the use operands. */
static vec<tree> build_uses;
FLAGS is as in get_expr_operands. */
static void
-get_indirect_ref_operands (struct function *fn,
- gimple stmt, tree expr, int flags)
+get_mem_ref_operands (struct function *fn,
+ gimple stmt, tree expr, int flags)
{
tree *pptr = &TREE_OPERAND (expr, 0);
/* Scan operands in the ASM_EXPR stmt referred to in INFO. */
static void
-get_asm_expr_operands (struct function *fn, gimple stmt)
+get_asm_stmt_operands (struct function *fn, gimple stmt)
{
size_t i, noutputs;
const char **oconstraints;
&& !is_gimple_debug (stmt))
mark_address_taken (TREE_OPERAND (expr, 0));
- /* If the address is invariant, there may be no interesting
- variable references inside. */
- if (is_gimple_min_invariant (expr))
- return;
-
/* Otherwise, there may be variables referenced inside but there
should be no VUSEs created, since the referenced objects are
not really accessed. The only operands that we should find
(GIMPLE does not allow non-registers as array indices). */
flags |= opf_no_vops;
get_expr_operands (fn, stmt, &TREE_OPERAND (expr, 0),
- flags | opf_not_non_addressable);
+ flags | opf_not_non_addressable | opf_address_taken);
return;
case SSA_NAME:
case VAR_DECL:
case PARM_DECL:
case RESULT_DECL:
- add_stmt_operand (fn, expr_p, stmt, flags);
+ if (!(flags & opf_address_taken))
+ add_stmt_operand (fn, expr_p, stmt, flags);
return;
case DEBUG_EXPR_DECL:
return;
case MEM_REF:
- get_indirect_ref_operands (fn, stmt, expr, flags);
+ get_mem_ref_operands (fn, stmt, expr, flags);
return;
case TARGET_MEM_REF:
switch (code)
{
case GIMPLE_ASM:
- get_asm_expr_operands (fn, stmt);
+ get_asm_stmt_operands (fn, stmt);
break;
case GIMPLE_TRANSACTION: