[Bug target/56831] New: [x86] sNaN value as a function call argument
tschwinge at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 3 12:03:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56831
Bug #: 56831
Summary: [x86] sNaN value as a function call argument
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: tschwinge@gcc.gnu.org
Target: i686
On 32-bit x86, using a sNaN value as a function call argument may turn it
into a qNaN (whilst raising an INVALID exception) already at the call
site, which is unexpected. This is due to using a flds, fstps sequence
(which according to my old Intel manuals correctly processes a float and
double sNaN value in this way), instead of just using a movl for pushing
the sNaN value onto the stack.
This only happens for some optimization flags together with volatile
declaration of the variable keeping the sNaN value; see the discussion in
<http://news.gmane.org/find-root.php?message_id=%3c87txonzdtd.fsf%40kepler.schwinge.homeip.net%3e>
and thereabouts, and the SNAN_TESTS_float and SNAN_TESTS_double usage in
glibc commit 5aa4a1a1fd742479818a668d42d91ca9ec4a6318,
<http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=5aa4a1a1fd742479818a668d42d91ca9ec4a6318>.
More information about the Gcc-bugs
mailing list