From owner-freebsd-toolchain@FreeBSD.ORG Sun Mar 22 21:36:18 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DC70480; Sun, 22 Mar 2015 21:36:18 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B514AB7; Sun, 22 Mar 2015 21:36:17 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::b11b:b36a:c2e8:f12e] (unknown [IPv6:2001:7b8:3a7:0:b11b:b36a:c2e8:f12e]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0CD355C4C; Sun, 22 Mar 2015 22:36:15 +0100 (CET) Subject: Re: Jenkins build is still unstable: FreeBSD_HEAD-tests2 #867 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C4B1A8DE-DE41-4ED5-BDEB-8B71E05450F7"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b6 From: Dimitry Andric In-Reply-To: Date: Sun, 22 Mar 2015 22:36:14 +0100 Message-Id: <864EB4DB-2DF7-4294-9498-95E54E6B49CC@FreeBSD.org> References: <1669399171.13.1427029129760.JavaMail.jenkins@jenkins-9.freebsd.org> <799490341.14.1427048792932.JavaMail.jenkins@jenkins-9.freebsd.org> <494AEF4B-0AF8-449A-9B41-9AC4F4552AF0@FreeBSD.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.2070.6) Cc: "freebsd-testing@freebsd.org" , freebsd-current Current , "jenkins-admin@freebsd.org" , freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2015 21:36:18 -0000 --Apple-Mail=_C4B1A8DE-DE41-4ED5-BDEB-8B71E05450F7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 22 Mar 2015, at 22:32, Craig Rodrigues wrote: >=20 > On Sun, Mar 22, 2015 at 2:29 PM, Dimitry Andric = wrote: >=20 > Ah right, that was on i386, on amd64 it does result in -2^63. It is = indeed caused by reliance on signed integer wrapping. >=20 > This diff should fix it, without rewriting the utility: >=20 > Index: bin/expr/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- bin/expr/Makefile (revision 280156) > +++ bin/expr/Makefile (working copy) > @@ -6,6 +6,9 @@ PROG=3D expr > SRCS=3D expr.y > YFLAGS=3D >=20 > +# expr relies on signed integer wrapping > +CFLAGS+=3D -fwrapv > + > NO_WMISSING_VARIABLE_DECLARATIONS=3D >=20 > .if ${MK_TESTS} !=3D "no" >=20 >=20 > Well, another alternative is to patch expr.y: >=20 > Index: expr.y > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- expr.y (revision 280353) > +++ expr.y (working copy) > @@ -393,7 +393,7 @@ > } >=20 > void > -assert_plus(intmax_t a, intmax_t b, intmax_t r) > +assert_plus(intmax_t a, intmax_t b, volatile intmax_t r) > { > /* > * sum of two positive numbers must be positive, > @@ -420,7 +420,7 @@ > } >=20 > void > -assert_minus(intmax_t a, intmax_t b, intmax_t r) > +assert_minus(intmax_t a, intmax_t b, volatile intmax_t r) > { > /* special case subtraction of INTMAX_MIN */ > if (b =3D=3D INTMAX_MIN && a < 0) >=20 >=20 > There were already some patches previously done to this > file to add "volatile", so maybe this would be OK to do. >=20 > What do you think? Volatile is not the solution, it is completely orthogonal. The correct way would be to use unsigned integers, for which wrapping is defined, then convert those back and forth when presenting the results to the user. -Dimitry --Apple-Mail=_C4B1A8DE-DE41-4ED5-BDEB-8B71E05450F7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.27 iEYEARECAAYFAlUPNc4ACgkQsF6jCi4glqO/9wCfbYOH487q9/Xe+cpNxEuEGkNU G78An3RQijg4XLH7Ca2YhJS7gyMCgzIQ =rYXe -----END PGP SIGNATURE----- --Apple-Mail=_C4B1A8DE-DE41-4ED5-BDEB-8B71E05450F7--