This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][improved-aliasing] Don't give up on struct-aliasing ifwe encounter arrays


On 08/31/05 10:33, Richard Guenther wrote:

*************** get_constraint_for_component_ref (tree t
*** 2075,2082 ****
}
/* assert that we found *some* field there. The user couldn't be
accessing *only* padding. */
! ! gcc_assert (curr);
}
else
if (dump_file && (dump_flags & TDF_DETAILS))
--- 2075,2083 ----
}
/* assert that we found *some* field there. The user couldn't be
accessing *only* padding. */
! /* Still the user could access one past the end of an array
! embedded in a struct resulting in accessing *only* padding. */
! /* gcc_assert (curr); */
}
else
if (dump_file && (dump_flags & TDF_DETAILS))


Hmm, how about we only skip the assertion for arrays then?

--- 5427,5452 ----
and extracts this single useful piece of information. */
static tree
! get_ref_tag (tree ref_)
{
! tree var = get_base_address (ref_);
! unsigned HOST_WIDE_INT offset, size;
! tree ref = okay_component_ref_for_subvars (ref_, &offset, &size);
tree tag;
+ if (ref)
+ {
+ subvar_t svars = get_subvars_for_var (ref);
+ subvar_t sv;
+ for (sv = svars; sv; sv = sv->next)
+ {
+ bool exact;
+ if (overlap_subvar (offset, size, sv, &exact)
+ && exact)
+ return sv->var;
+ }
+ }
+ if (!var)
return NULL_TREE;


Why exactly do you need this?

*************** rewrite_use (struct ivopts_data *data,
*** 5745,5750 ****
--- 5760,5766 ----
gcc_unreachable ();
}
update_stmt (use->stmt);
+ mark_new_vars_to_rename (use->stmt);
}


And this?

Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.100
diff -c -3 -p -r2.100 tree-ssa-operands.c
*** tree-ssa-operands.c 2 Aug 2005 11:46:44 -0000 2.100
--- tree-ssa-operands.c 11 Aug 2005 08:28:05 -0000
*************** get_expr_operands (tree stmt, tree *expr
*** 1311,1316 ****
--- 1311,1317 ----
{
tree ref;
unsigned HOST_WIDE_INT offset, size;
+ bool none = true;
/* This component ref becomes an access to all of the subvariables
it can touch, if we can determine that, but *NOT* the real one.
If we can't determine which fields we could touch, the recursion
*************** get_expr_operands (tree stmt, tree *expr
*** 1328,1342 ****
if (overlap_subvar (offset, size, sv, &exact))
{
int subvar_flags = flags;
if (!exact)
subvar_flags &= ~opf_kill_def;
add_stmt_operand (&sv->var, s_ann, subvar_flags);
}
}
}
! else
! get_expr_operands (stmt, &TREE_OPERAND (expr, 0), ! flags & ~opf_kill_def);

if (code == COMPONENT_REF)
{
--- 1329,1345 ----
if (overlap_subvar (offset, size, sv, &exact))
{
int subvar_flags = flags;
+ none = false;
if (!exact)
subvar_flags &= ~opf_kill_def;
add_stmt_operand (&sv->var, s_ann, subvar_flags);
}
}
+ if (!none)
+ flags |= opf_no_vops;
}
! get_expr_operands (stmt, &TREE_OPERAND (expr, 0), ! flags & ~opf_kill_def);

if (code == COMPONENT_REF)
{




And this?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]