This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23855] loop header should also be pulled out of the inner loop too
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Aug 2016 08:24:44 +0000
- Subject: [Bug tree-optimization/23855] loop header should also be pulled out of the inner loop too
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-23855-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23855
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ysrumyan at gmail dot com
--- Comment #30 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, unfortunately it doesn't fully work for
void bar(void);
void foo(int ie, int je, int ke)
{
int i, j, k;
for (k=0; k<ke; ++k)
for (j=0; j<je; ++j)
for (i=0; i<ie; ++i)
bar();
}
it hoists the header check one level but it doesn't manage to hoist the
ie > 0 check all the way up out of the k loop. I suppose iterating
find_loop_guard in some way would work. I have a patch in testing.