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; 2+ 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] 2+ messages in thread

* [Bug tree-optimization/38011] vectorizer ignores alignment, useless versioning
  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 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-04 15:50 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement
          Component|c                           |tree-optimization
           Keywords|                            |missed-optimization


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


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

end of thread, other threads:[~2008-11-04 15:50 UTC | newest]

Thread overview: 2+ 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

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