public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/56831] New: [x86] sNaN value as a function call argument
@ 2013-04-03 12:03 tschwinge at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: tschwinge at gcc dot gnu.org @ 2013-04-03 12:03 UTC (permalink / raw)
  To: gcc-bugs


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>.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-03 12:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-03 12:03 [Bug target/56831] New: [x86] sNaN value as a function call argument tschwinge at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).