public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/43182]  New: gcc could not vectorize this simple loop (un-handled data-ref)
@ 2010-02-25 23:37 changpeng dot fang at amd dot com
  2010-02-25 23:50 ` [Bug middle-end/43182] GCC does not pull out a[0] from loop that changes a[i] for i:[1,n] pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-02-25 23:37 UTC (permalink / raw)
  To: gcc-bugs

gcc 4.5 can not vectorize this simple loop:

void foo(int a[], int n) {
 int i;
 for(i=1; i< n; i++)
  a[i] = a[0];
}

"gcc -O3 -fdump-tree-vect-all -c foo.c" shows:
foo.c:3: note: not vectorized: unhandled data-ref 
foo.c:3: note: bad data references.
foo.c:1: note: vectorized 0 loops in function.

It seems gcc gets confused at a[0] and gives up vectorization. There
is no dependence in this loop, and we should teach gcc to handle a[0]
to vectorize it.


-- 
           Summary: gcc could not vectorize this simple loop (un-handled
                    data-ref)
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: changpeng dot fang at amd dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43182


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-26  7:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43182-4@http.gcc.gnu.org/bugzilla/>
2021-07-26  7:45 ` [Bug middle-end/43182] GCC does not pull out a[0] from loop that changes a[i] for i:[1,n] pinskia at gcc dot gnu.org
2010-02-25 23:37 [Bug middle-end/43182] New: gcc could not vectorize this simple loop (un-handled data-ref) changpeng dot fang at amd dot com
2010-02-25 23:50 ` [Bug middle-end/43182] GCC does not pull out a[0] from loop that changes a[i] for i:[1,n] pinskia at gcc dot gnu dot org
2010-02-25 23:54 ` pinskia at gcc dot gnu dot org
2010-02-26 18:53 ` changpeng dot fang at amd dot com
2010-02-26 18:55 ` pinskia at gcc dot gnu dot org
2010-02-26 19:06 ` changpeng dot fang at amd dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).