public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "David dot Monniaux at ens dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/38011]  New: vectorizer ignores alignment, useless versioning
Date: Tue, 04 Nov 2008 14:59:00 -0000	[thread overview]
Message-ID: <bug-38011-11859@http.gcc.gnu.org/bugzilla/> (raw)

When compiling:

void assignMultiplyVec(double* restrict __attribute__ ((aligned (16))) a, const
double * restrict __attribute__ ((aligned (16))) b, double coef, unsigned
count) {
  for(unsigned i=0; i<count; i++) {
    a[i] = b[i]*coef;
  }
}

Using: gcc -std=c99 -march=core2 -mtune=core2 -O3 -mfpmath=sse -ftree-vectorize
-ftree-vectorizer-verbose=9

The logs show:
essai_restrict_ref.c:2: note: Alignment of access forced using versioning.
essai_restrict_ref.c:2: note: Versioning for alignment will be applied.
essai_restrict_ref.c:2: note: Vectorizing an unaligned access.
and indeed the assembly code shows a test whether operands are 16-byte aligned.

This versioning is superfluous, since variable attributes guarantee 16-byte
alignment.


-- 
           Summary: vectorizer ignores alignment, useless versioning
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: David dot Monniaux at ens dot fr
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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


             reply	other threads:[~2008-11-04 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 14:59 David dot Monniaux at ens dot fr [this message]
2008-11-04 15:50 ` [Bug tree-optimization/38011] " rguenth at gcc dot gnu dot org

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-38011-11859@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).