From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13883 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: FE Exception triggered by comparison Date: Wed, 27 Feb 2019 19:00:38 +0300 (MSK) Message-ID: References: <20190224192511.GZ21289@port70.net> <20190224210438.6980bd87@inria.fr> <20190225155109.GB28106@voyager> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="146850"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) To: musl@lists.openwall.com Original-X-From: musl-return-13899-gllmg-musl=m.gmane.org@lists.openwall.com Wed Feb 27 17:00:52 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1gz1db-000c8A-Vb for gllmg-musl@m.gmane.org; Wed, 27 Feb 2019 17:00:52 +0100 Original-Received: (qmail 17463 invoked by uid 550); 27 Feb 2019 16:00:49 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 17442 invoked from network); 27 Feb 2019 16:00:49 -0000 In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:13883 Archived-At: On Thu, 28 Feb 2019, Damian McGuckin wrote: > I tried the code below, I was just shocked. > > #include > #include > > main() > { > double x = 5.0; > > x -= x, x /= x; > printf("what %s\n", isnan(x) ? "yes" : "no!"); > return(0); > } > > Looking at the assembler, there is a subroutine call to __isnan. Awful! Hm, no, for x86 with GCC you should not see that: the compiler knows how to expand isnan efficiently. Are you perhaps on OS X and the 'gcc' command actually invokes Clang/LLVM? If not, can you show output of 'gcc -v', command-line flags you used, and the assembly you're seeing? Thanks. Alexander