public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38011]  New: vectorizer ignores alignment, useless versioning
@ 2008-11-04 14:59 David dot Monniaux at ens dot fr
  2008-11-04 15:50 ` [Bug tree-optimization/38011] " rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 4+ messages in thread
From: David dot Monniaux at ens dot fr @ 2008-11-04 14:59 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <bug-38011-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2013-03-27 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-04 14:59 [Bug c/38011] New: vectorizer ignores alignment, useless versioning David dot Monniaux at ens dot fr
2008-11-04 15:50 ` [Bug tree-optimization/38011] " rguenth at gcc dot gnu dot org
     [not found] <bug-38011-4@http.gcc.gnu.org/bugzilla/>
2012-07-13  8:56 ` rguenth at gcc dot gnu.org
2013-03-27 12:35 ` rguenth at gcc dot gnu.org

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).