This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/37810] Bad store sinking job
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Oct 2008 15:25:42 -0000
- Subject: [Bug tree-optimization/37810] Bad store sinking job
- References: <bug-37810-7035@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-10-12 15:25 -------
The original testcase (from an IRC discussion) reduced to a C testcase is:
struct A {
int n;
int m;
};
void g();
void test (struct A* iter)
{
struct A end = { 0, 0 };
while (iter->n != end.n)
{
iter->n = iter->n + 1;
if (iter->n == iter->m)
g();
}
}
where there is an optimization possibility to sink the store to iter->n to
before the call and apply load-store motion to iter->n for the remaining loop.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |alias
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37810