<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Compile time optimization generates wrong results with AVX intrinsics"
href="https://llvm.org/bugs/show_bug.cgi?id=23441">23441</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Compile time optimization generates wrong results with AVX intrinsics
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>gentryx@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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=<a href="https://bugs.gentoo.org/">https://bugs.gentoo.org/</a>
--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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>