From owner-freebsd-testing@FreeBSD.ORG Mon Mar 23 09:39:30 2015 Return-Path: Delivered-To: freebsd-testing@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 AC3F2F5A; Mon, 23 Mar 2015 09:39:30 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C361C94; Mon, 23 Mar 2015 09:39:29 +0000 (UTC) Received: from [192.168.0.7] (cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t2N9b8Ld024621 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Mar 2015 09:38:23 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61] claimed to be [192.168.0.7] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: Jenkins build is still unstable: FreeBSD_HEAD-tests2 #867 From: David Chisnall In-Reply-To: Date: Mon, 23 Mar 2015 09:33:15 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: 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> <864EB4DB-2DF7-4294-9498-95E54E6B49CC@FreeBSD.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.2070.6) Cc: "freebsd-testing@freebsd.org" , "jenkins-admin@freebsd.org" , freebsd-current Current , Dimitry Andric , freebsd-toolchain@freebsd.org X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 09:39:30 -0000 On 22 Mar 2015, at 22:01, Craig Rodrigues wrote: >=20 >> 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. >>=20 >=20 > OK, converting expr.y to use unsigned integers would require a bit of = work. Note that clang has, for a few releases, had builtins that allow = overflow-checked operations and will generate very efficient code. In = op_times, I believe the following should work: long long mul; #if __has_builtin(__builtin_smulll_overflow) if (__builtin_smulll_overflow(a->u.i, b->u.i, &mul)) errx(ERR_EXIT, "overflow");=20 #else mul =3D a->u.i * b->u.i; #endif r =3D make_integer(mul); I don't know if recent versions of gcc implement these builtins yet. I = think they were added to clang around 3.4, possibly slightly earlier. =20= David