This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48052] loop not vectorized if index is "unsigned int"
- From: "evstupac at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 23 Jun 2015 13:23:19 +0000
- Subject: [Bug tree-optimization/48052] loop not vectorized if index is "unsigned int"
- Auto-submitted: auto-generated
- References: <bug-48052-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48052
Stupachenko Evgeny <evstupac at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |evstupac at gmail dot com
--- Comment #15 from Stupachenko Evgeny <evstupac at gmail dot com> ---
The commit caused regressions on some benchmarks. Test to reproduce:
(compilations flags: -Ofast)
int foo (int flag, char *a)
{
short i, j;
short l = 0;
if (flag == 1)
l = 3;
for (i = 0; i < 4; i++)
{
for (j = l - 1; j > 0; j--)
a[j] = a[j - 1];
a[0] = i;
}
}
Here value of l is between 0 and 3, and therefore value of the innermost loop
bound (l - 1) is between -1 and 2.
After the commit the innermost loop is replaced with memmove call. This is
obviously not optimal as amount of memory to move is not greater than 2.