From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: (elisp)Numbers Date: 26 Oct 2003 08:04:31 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200310210229.h9L2TGl12085@raven.dms.auburn.edu> <9743-Wed22Oct2003174239+0200-eliz@elta.co.il> <9178-Fri24Oct2003155041+0200-eliz@elta.co.il> <3099-Sat25Oct2003001556+0200-eliz@elta.co.il> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1067148377 10667 80.91.224.253 (26 Oct 2003 06:06:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 26 Oct 2003 06:06:17 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Oct 26 07:06:15 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ADe2Z-0003VT-00 for ; Sun, 26 Oct 2003 07:06:15 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ADe2Z-0005Bh-00 for ; Sun, 26 Oct 2003 07:06:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ADdzc-0000Up-8w for emacs-devel@quimby.gnus.org; Sun, 26 Oct 2003 01:03:12 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ADdzW-0000Rq-UD for emacs-devel@gnu.org; Sun, 26 Oct 2003 01:03:06 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ADdz0-00008V-37 for emacs-devel@gnu.org; Sun, 26 Oct 2003 01:03:05 -0500 Original-Received: from [207.232.27.5] (helo=WST0054) by monty-python.gnu.org with asmtp (Exim 4.24) id 1ADdyz-00008M-IB; Sun, 26 Oct 2003 01:02:33 -0500 Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Sat, 25 Oct 2003 18:26:38 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17431 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17431 > From: Richard Stallman > Date: Sat, 25 Oct 2003 18:26:38 -0400 > > Here's the code I see with "gcc -E -O2" on fencepost (I reformatted it > for better readability): > > extern __inline double sqrt ( double __x) > { > register double __result; > __asm __volatile__ ( "fsqrt" : "=t" (__result) : "0" (__x) ); > return __result; > } > > 1. where does this code come from? which file in which package? This is part of cpp's output when I run on floatfns.c the same command as when it is compiled into floatfns.o, but with -c replaced with -E. For the build on fencepost, this is the command I ran: gcc -E -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/e/eliz/emacs/src -D_BSD_SOURCE -O2 floatfns.c | less -ci If you omit -O2, the inline expansion of `sqrt' doesn't appear in the output, so the library function is called. The expansion itself seems to come from /usr/include/bits/mathinline.h, which is part of glibc, since immediately before the above snippet, I see this line: # 438 "/usr/include/bits/mathinline.h" 3 mathinlines.h has this near line 438: __inline_mathopNP (sqrt, "fsqrt") which, after a series of macro expansions, eventually expands into the above inline definition of `sqrt'. Similar things happen with other math functions. It sounds like under -O2 no math function ever sets errno. > 2. i see that my CFLAGS setting to turn off inlining got lost > when i reran configure. so i put that back in and recompiled, > and it went away. What went away? You mean that Emacs did throw a domain error when floatfns.c was compiled without optimizations? Anyway, we do want floatfns.c to be compiled with optimization and still DTRT, right?