<div dir="ltr"><div>If LLVM is built with certain versions of gcc, as Release x86-32 binaries, it may incorrectly transform 64-bit integer constants in the user's source code.  Specifically, a constant like 0xfff0000000000001</div>
<div>that has the same bit representation as a signaling NaN may be transformed to the quiet NaN representation.  Gcc 4.6.3 is known to have this bug, as well as 4.7.</div><div><br></div><div>A simple workaround avoids triggering the gcc bug.</div>
<div><br></div><div>Manual searching for similar patterns in the Clang and LLVM code bases found no other similar patterns, specifically a union containing a double field and a 64-bit integer field, with a constructor that initializes the double field.</div>
<div><br></div><div>Gcc bug report: <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58416">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58416</a></div><div><br></div><div>On my x86-64 system, with gcc 4.6.3, the attached lit test triggers the bug when LLVM is configured this way:</div>
<div>    CC=gcc CXX=g++ ../llvm/configure --enable-optimized --with-extra-options=-m32 --with-extra-ld-options=-m32<br></div></div>