This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/52693] Wrong code with SRA and arrays
- From: "jamborm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Mar 2012 22:30:08 +0000
- Subject: [Bug middle-end/52693] Wrong code with SRA and arrays
- Auto-submitted: auto-generated
- References: <bug-52693-4@http.gcc.gnu.org/bugzilla/>
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.