This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/84013] wrong __restrict clique with inline asm operand
- From: "katsunori.kumatani at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 31 Jan 2018 19:31:15 +0000
- Subject: [Bug tree-optimization/84013] wrong __restrict clique with inline asm operand
- Auto-submitted: auto-generated
- References: <bug-84013-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84013
--- Comment #2 from Katsunori Kumatani <katsunori.kumatani at gmail dot com> ---
I'm not familiar with tree-ssa-structalias, but it appears to me that the "fix"
is quite simple? Or am I missing something? Here's the snippet from it, updated
with my attempt:
if (restrict_var)
{
/* Now look at possible dereferences of ptr. */
imm_use_iterator ui;
gimple *use_stmt;
bool used = false;
FOR_EACH_IMM_USE_STMT (use_stmt, ui, ptr)
{
if (!gimple_assign_single_p (use_stmt))
{
/* ??? Calls. */
if (gimple_code (use_stmt) != GIMPLE_ASM)
continue;
gasm *asm_stmt = as_a <gasm *> (use_stmt);
unsigned n = gimple_asm_ninputs (asm_stmt);
for (unsigned i = 0; i < n; i++)
{
tree op = TREE_VALUE (gimple_asm_input_op (asm_stmt, i));
used |= maybe_set_dependence_info (op, ptr, clique,
restrict_var,
last_ruid);
}
n = gimple_asm_noutputs (asm_stmt);
for (unsigned i = 0; i < n; i++)
{
tree op = TREE_VALUE (gimple_asm_output_op (asm_stmt,
i));
used |= maybe_set_dependence_info (op, ptr, clique,
restrict_var,
last_ruid);
}
continue;
}
Does this not work? Sorry if I am missing something here.