[Bug tree-optimization/32168] New: vectorizer doesn't handle vector condition with simple assignment

hjl at lucon dot org gcc-bugzilla@gcc.gnu.org
Thu May 31 17:54:00 GMT 2007


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


-- 
           Summary: vectorizer doesn't handle vector condition with simple
                    assignment
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org


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



More information about the Gcc-bugs mailing list