Commit 7c35745c by Diego Novillo Committed by Diego Novillo

tree-ssa-operands.c (get_asm_expr_operands): Fix thinkos in the handling of clobbering ASM_EXPRs.


	* tree-ssa-operands.c (get_asm_expr_operands): Fix thinkos in
	the handling of clobbering ASM_EXPRs.

From-SVN: r84292
parent 6f2838e3
2004-07-08 Diego Novillo <dnovillo@redhat.com>
* tree-ssa-operands.c (get_asm_expr_operands): Fix thinkos in
the handling of clobbering ASM_EXPRs.
2004-07-08 Eric Botcazou <ebotcazou@libertysurf.fr> 2004-07-08 Eric Botcazou <ebotcazou@libertysurf.fr>
PR target/16430 PR target/16430
......
...@@ -1164,8 +1164,9 @@ get_expr_operands (tree stmt, tree *expr_p, int flags, voperands_t prev_vops) ...@@ -1164,8 +1164,9 @@ get_expr_operands (tree stmt, tree *expr_p, int flags, voperands_t prev_vops)
abort (); abort ();
} }
/* Scan operands in ASM_EXPR STMT. PREV_VOPS is as in
append_v_may_def and append_vuse. */ /* Scan operands in ASM_EXPR STMT. PREV_VOPS is as in append_v_may_def and
append_vuse. */
static void static void
get_asm_expr_operands (tree stmt, voperands_t prev_vops) get_asm_expr_operands (tree stmt, voperands_t prev_vops)
...@@ -1223,47 +1224,43 @@ get_asm_expr_operands (tree stmt, voperands_t prev_vops) ...@@ -1223,47 +1224,43 @@ get_asm_expr_operands (tree stmt, voperands_t prev_vops)
get_expr_operands (stmt, &TREE_VALUE (link), 0, prev_vops); get_expr_operands (stmt, &TREE_VALUE (link), 0, prev_vops);
} }
/* Clobber memory for asm ("" : : : "memory"); */ /* Clobber memory for asm ("" : : : "memory"); */
if (!aliases_computed_p) for (link = ASM_CLOBBERS (stmt); link; link = TREE_CHAIN (link))
{ if (strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory") == 0)
/* If we still have not computed aliasing information, {
mark the statement as having volatile operands to avoid size_t i;
optimizations from messing around with it. */
stmt_ann (stmt)->has_volatile_ops = true; /* If we still have not computed aliasing information, we
} won't know what variables are call-clobbered and/or
else addressable. Just mark the statement as having volatile
{ operands for now. */
/* Otherwise, if this ASM_EXPR clobbers memory, clobber if (!aliases_computed_p)
all the call-clobbered variables and the addressable
variables found by the alias analyzer. */
for (link = ASM_CLOBBERS (stmt); link; link = TREE_CHAIN (link))
if (!strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory"))
{ {
/* If we had created .GLOBAL_VAR earlier, use it. stmt_ann (stmt)->has_volatile_ops = true;
Otherwise, add a V_MAY_DEF operand for every break;
call-clobbered and addressable variable. See }
compute_may_aliases for the heuristic used to decide
whether to create .GLOBAL_VAR or not. */ /* Clobber all call-clobbered variables (or .GLOBAL_VAR if we
if (global_var) decided to group them). */
add_stmt_operand (&global_var, stmt, opf_is_def, prev_vops); if (global_var)
else add_stmt_operand (&global_var, stmt, opf_is_def, prev_vops);
else
EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i,
{ {
size_t i; tree var = referenced_var (i);
add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
});
EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, /* Now clobber all addressables. */
{ EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i,
tree var = referenced_var (i); {
add_stmt_operand (&var, stmt, opf_is_def, prev_vops); tree var = referenced_var (i);
}); add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
});
EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i, break;
{ }
tree var = referenced_var (i);
add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
});
}
}
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment