[PATCH] Work around a gcc x86-32 code generation bug
Jim Stichnoth
stichnot at google.com
Mon Sep 16 13:46:13 PDT 2013
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
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.
A simple workaround avoids triggering the gcc bug.
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.
Gcc bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58416
On my x86-64 system, with gcc 4.6.3, the attached lit test triggers the bug
when LLVM is configured this way:
CC=gcc CXX=g++ ../llvm/configure --enable-optimized
--with-extra-options=-m32 --with-extra-ld-options=-m32
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130916/93a5e007/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-union-bug-fix.patch
Type: application/octet-stream
Size: 2365 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130916/93a5e007/attachment.obj>
More information about the llvm-commits
mailing list