public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18439] New: vectorizer failed for vector normalization
@ 2004-11-12  1:33 giovannibajo at libero dot it
  2004-11-12  2:43 ` [Bug tree-optimization/18439] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-12  1:33 UTC (permalink / raw)
  To: gcc-bugs

Vectorizer fails to handle this:

-----------------------------------------------------
extern "C" double sqrt(double);

#define NUMPOINTS 50000

static float points[NUMPOINTS][4];
static float opoints[NUMPOINTS][4];
static bool flags[NUMPOINTS];

void NormalizeVectors (void)
{
  int i, r;
  float s, x, y, z;
  static float d = 0.0;

  d += 0.2;
  if (d > 4) d = 0.0;

  for (r=0; r<4; r++)
  {
    for (i=0; i<NUMPOINTS; i++)
    {
      x = points[i][0];
      y = points[i][1];
      z = points[i][2];
      s = x * x
        + y * y
        + z * z;
      s = d / sqrt (s);
      opoints[i][0] = x * s;
      opoints[i][1] = y * s;
      opoints[i][2] = z * s;
      flags[i] = true;
    }
  }
}
-----------------------------------------------------

loop at bench.cc:79: not vectorized: unhandled data ref: d.0_36 = d
loop at bench.cc:79: bad data references.



This is a bit more complex than the other two I posted, I guess. Anyway, the 
first problem seems related to the static variable.

-- 
           Summary: vectorizer failed for vector normalization
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giovannibajo at libero dot it
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-02-11 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-12  1:33 [Bug tree-optimization/18439] New: vectorizer failed for vector normalization giovannibajo at libero dot it
2004-11-12  2:43 ` [Bug tree-optimization/18439] " pinskia at gcc dot gnu dot org
2005-02-11 19:24 ` pinskia at gcc dot gnu dot org
2005-02-11 19:34 ` pinskia 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).