https://llvm.org/bugs/show_bug.cgi?id=23441
Bug ID: 23441
Summary: Compile time optimization generates wrong results with
AVX intrinsics
Product: clang
Version: 3.6
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Attached code uses expression templates to perform vectorized arithmetic. The
output generated after compiling with clang++ 3.6 is wrong: the upper two
vector lanes remain set to 0. Sample output of clang vs. gcc below. This bug is
not present in clang 3.5.
gentryx@neuromancer ~ $ clang++ -v ; clang++ -O3 -march=native test.cpp -g -o
test2 && ./test2
clang version 3.6.0 (tags/RELEASE_360/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4
vec[0] = 1.2
vec[1] = 2.4
vec[2] = 0
vec[3] = 0
gentryx@neuromancer ~ $ g++ -v ; g++ -O3 -march=native test.cpp -g -o test2 &&
./test2
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.4/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.4/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.4
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.4
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.4/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.4/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/include/g++-v4
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.4/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.8.4 p1.0, pie-0.6.1' --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj
--enable-libgomp --disable-libmudflap --disable-libssp --enable-lto
--without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.8.4 (Gentoo 4.8.4 p1.0, pie-0.6.1)
vec[0] = 1.2
vec[1] = 2.4
vec[3] = 3.6
vec[4] = 4.8
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs