From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Strange problems with data-tests.el Date: Sun, 12 Aug 2018 21:37:18 +0300 Message-ID: <831sb3l9cx.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1534098965 1057 195.159.176.226 (12 Aug 2018 18:36:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Aug 2018 18:36:05 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 12 20:36:01 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fovDa-0008To-FX for ged-emacs-devel@m.gmane.org; Sun, 12 Aug 2018 20:35:58 +0200 Original-Received: from localhost ([::1]:35892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fovFc-0005lt-0E for ged-emacs-devel@m.gmane.org; Sun, 12 Aug 2018 14:38:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fovEq-0005ki-ER for emacs-devel@gnu.org; Sun, 12 Aug 2018 14:37:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fovEn-0007bW-AM for emacs-devel@gnu.org; Sun, 12 Aug 2018 14:37:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fovEn-0007bF-5q for emacs-devel@gnu.org; Sun, 12 Aug 2018 14:37:13 -0400 Original-Received: from [176.228.60.248] (port=2596 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fovEm-0005uQ-HM for emacs-devel@gnu.org; Sun, 12 Aug 2018 14:37:12 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228451 Archived-At: The newly built master (including bignums and after removing misc) passed src/data-tests.el for an unoptimized build and for an -O2 optimized build. When I tried the -Og optimized build, it failed the tests. The reason for the failures seems to be that the following expression yields nil, whereas the test expects it to yield t: (< 0.5 most-positive-fixnum (+ 1.0 most-positive-fixnum)) (This is a 32-bit build --with-wide-int, using GCC 7.3.0.) I stepped with a debugger through arithcompare. The values involved aren't easy to display, and optimizations don't help, but after some tinkering with "nexti" and "info float", it looks like the values of f1 and f2 are loaded into FP registers when this line is executed: fneq = f1 != f2; which correctly yields 'true' (as there's no loss of precision in both values), but when we get to this line: case ARITH_LESS: test = fneq ? f1 < f2 : i1 < i2; what I seem to see in the 2 FP registers is the same value(??), and in any case 'test' comes out 'false'. ("info address" at this point tells me that both f1 and f2 are "complex DWARF expressions", so perhaps what I see in the FP registers is not the real values.) This all looks like a compiler bug, but the code looks too simple for that, so perhaps it's some subtlety that only trips us in this combination: 32-bit build with 64-bit EMACS_INT and some FP values in 80-bit extended-precision registers? Rebuilding with -O2 makes the problem go away, but why should -Og (whose optimizations are almost exactly -O1) fail to work here? Any ideas for how to pursue this further?