Bug 32168 - vectorizer doesn't handle vector condition with simple assignment
Summary: vectorizer doesn't handle vector condition with simple assignment
Status: RESOLVED DUPLICATE of bug 21997
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-31 17:54 UTC by H.J. Lu
Modified: 2007-05-31 18:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2007-05-31 17:54:48 UTC
[hjl@gnu-2 vect]$ cat x.c
typedef char vec_t;

extern __attribute__((aligned(16))) vec_t x [64];
extern __attribute__((aligned(16))) vec_t y [64];
extern __attribute__((aligned(16))) vec_t m [64];

void
foo1 ()
{
  int i;

  for (i = 0; i < 64; i++)
    m [i] = x [i] == y [i] ? 1 : 2;
}

void
foo2 ()
{
  int i;

  for (i = 0; i < 64; i++)
    m [i] = x [i] == y [i];
}
[hjl@gnu-2 vect]$ /export/build/gnu/gcc-nni/build-x86_64-linux/gcc/xgcc -B./ -B/export/build/gnu/gcc-nni/build-x86_64-linux/gcc/ -O2 -msse4.2 -ftree-vectorize -ftree-vectorizer-verbose=3 -S x.c

x.c:12: note: LOOP VECTORIZED.
x.c:9: note: vectorized 1 loops in function.

x.c:21: note: not vectorized: stmt not supported: D.2111_8 = D.2109_5 == D.2110_7
x.c:18: note: vectorized 0 loops in function.
[hjl@gnu-2 vect]$ 

m [i] = x [i] == y [i] ? 1 : 2;

works. But

m [i] = x [i] == y [i];

doesn't work.
Comment 1 Andrew Pinski 2007-05-31 18:11:50 UTC

*** This bug has been marked as a duplicate of 21997 ***