From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id CE4A37F787 for ; Mon, 7 Nov 2016 17:20:30 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=rich@annexia.org; spf=Pass smtp.mailfrom=rich@annexia.org; spf=Pass smtp.helo=postmaster@annexia.org Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of rich@annexia.org) identity=pra; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="rich@annexia.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of rich@annexia.org designates 80.68.91.176 as permitted sender) identity=mailfrom; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="rich@annexia.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@annexia.org designates 80.68.91.176 as permitted sender) identity=helo; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="postmaster@annexia.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" IronPort-PHdr: =?us-ascii?q?9a23=3AwaT15RaEkVwBcQzPF5AELk7/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpcu/bnLW6fgltlLVR4KTs6sC0LuM9fG8Ejdaqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZv?= =?us-ascii?q?IaytQ8iJ3p7xhrz5oMebSj4LrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYe?= =?us-ascii?q?VcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYCgJ45jbvAfC?= =?us-ascii?q?QBHHwnYGVXRexgpBHQnI9lf+U432owP7sPB80W+UJ5ulY6ozXGHo1aZgSBbyhG?= =?us-ascii?q?84cRt/uEPQjMFrxuoPuhOqpzR2xYjZcICccv1kcfWOLpshWWNdU5MJBGR6CYSm?= =?us-ascii?q?Yt5KVrJZMA=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DtAQBvqCBY/7BbRFBdGwEBAQMBAQEJA?= =?us-ascii?q?QEBFgEBAQMBAQEJAQEBgwMBAQEBAR9YfIJ5ij+VWQEBAQEBAQaBHJRSgggphXs?= =?us-ascii?q?Cggk/FAEBAQEBAQEBAQEBYSiCMwQBFQEEghABAQQ6PxALGAkTEg8FKCGIbwq0C?= =?us-ascii?q?4s/AQEBAQEFAQEBAR4FhXRAhF+KJwWIRYdMihYBhjSKBJAbjSqEBh43ehuFDz4?= =?us-ascii?q?0AYV7gU4BAQE?= X-IPAS-Result: =?us-ascii?q?A0DtAQBvqCBY/7BbRFBdGwEBAQMBAQEJAQEBFgEBAQMBAQE?= =?us-ascii?q?JAQEBgwMBAQEBAR9YfIJ5ij+VWQEBAQEBAQaBHJRSgggphXsCggk/FAEBAQEBA?= =?us-ascii?q?QEBAQEBYSiCMwQBFQEEghABAQQ6PxALGAkTEg8FKCGIbwq0C4s/AQEBAQEFAQE?= =?us-ascii?q?BAR4FhXRAhF+KJwWIRYdMihYBhjSKBJAbjSqEBh43ehuFDz40AYV7gU4BAQE?= X-IronPort-AV: E=Sophos;i="5.31,606,1473112800"; d="scan'208";a="199504294" Received: from annexia.org ([80.68.91.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 07 Nov 2016 17:19:45 +0100 Received: from rich by annexia.org with local (Exim 4.84_2) (envelope-from ) id 1c3me7-0004Zz-Ru; Mon, 07 Nov 2016 16:19:43 +0000 Date: Mon, 7 Nov 2016 16:19:43 +0000 From: "Richard W.M. Jones" To: Xavier Leroy Cc: caml-list@inria.fr Message-ID: <20161107161943.GI27249@annexia.org> References: <20161107132201.GG27249@annexia.org> <20161107154843.GH27249@annexia.org> <6a64a161-4ed0-fb07-caa1-4bf3c7f91c23@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a64a161-4ed0-fb07-caa1-4bf3c7f91c23@inria.fr> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [Caml-list] Zarith problems on ppc64le On Mon, Nov 07, 2016 at 04:58:24PM +0100, Xavier Leroy wrote: > On 07/11/2016 16:48, Richard W.M. Jones wrote: > > On Mon, Nov 07, 2016 at 01:22:01PM +0000, Richard W.M. Jones wrote: > >> > >> https://bugzilla.redhat.com/show_bug.cgi?id=1392247 > >> > >> Zarith fails tests on OCaml 4.04.0 + ppc64le with some fairly gross > >> errors, eg: > >> > >> of_float -1. > >> - = -1 > >> + = 0 > >> > >> (It passes fine on OCaml 4.04.0 + ppc64) > >> > >> The implementation of Zarith is quite complex and I've so far failed > >> to understand what's going on. > > > > FWIW this seems like it is invoking undefined behaviour in C. See > > my analysis here: > > > > https://bugzilla.redhat.com/show_bug.cgi?id=1392247#c3 > > Yes, something is weird here. You can try to put > > return Val_long((intnat) x); > > on line 524: it should fix the issue that you suspect. > > If this is the source of the problem, I'm surprised that it doesn't > break on other platforms as well. Yup that's exactly the fix I came up with: https://bugzilla.redhat.com/show_bug.cgi?id=1392247#c6 There may be other places which make this assumption, but with just that fix the tests pass successfully on ppc64le. Thanks, Rich.