[Bug middle-end/52693] Wrong code with SRA and arrays
jamborm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 23 22:46:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52693
Martin Jambor <jamborm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|mjambor at suse dot cz |jamborm at gcc dot gnu.org
--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-03-23 22:30:08 UTC ---
(In reply to comment #0)
> With the attach testcase, SRA does the following replacement which seems wrong:
> value = stack.l[D.4470_102];
> With
> value_77 = MEM[(struct exprList_s *)&stack];
> value$u_620 = MEM[(struct exprList_s *)&stack].u;
>
It is confusing but I do not think it is wrong. When you disable the
special handling of enumeral types in analyze_access_subtree, you get
(in this case IMHO equivalent):
value$type_621 = MEM[(struct exprList_s *)&stack].type;
value$u_622 = MEM[(struct exprList_s *)&stack].u;
which is exactly what we'd expect when breaking value into the two
components it consists of. And the testcase still fails.
It is equivalent because the first MEM_REF is of type unsigned int,
whereas the second one loads the whole structure and then there's a
COMPONENT_REF to load only the second integer from it.
More information about the Gcc-bugs
mailing list