This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51499] vectorizer missing simple case
- From: "irar at il dot ibm.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 Dec 2011 16:27:19 +0000
- Subject: [Bug tree-optimization/51499] vectorizer missing simple case
- Auto-submitted: auto-generated
- References: <bug-51499-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51499
--- Comment #14 from Ira Rosen <irar at il dot ibm.com> 2011-12-13 16:27:19 UTC ---
(In reply to comment #13)
>
> However, I don't fully understand Richard Guenther's example. Yes his
> example requires -fassociative-math to be vectorized, however, my example
> would translate to something like
>
> sum1 += a[i];
> sum2 += a[i+1];
>
> and now it doesn't matter if it's executed this way or the other way
> around
>
> sum2 += a[i+1];
> sum1 += a[i];
The problem is probably more in implementation. The change of order will also
change between sum1 and sum2, so when you want to return sum1+sum2, the
vectorized version will return sum2+sum1.