public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "changpeng dot fang at amd dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/43182]  New: gcc could not vectorize this simple loop (un-handled data-ref)
Date: Thu, 25 Feb 2010 23:37:00 -0000	[thread overview]
Message-ID: <bug-43182-18740@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2010-02-25 23:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-25 23:37 changpeng dot fang at amd dot com [this message]
2010-02-25 23:45 ` [Bug middle-end/43182] " pinskia at gcc dot gnu dot org
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-43182-18740@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).