From owner-freebsd-current@FreeBSD.ORG Tue Jan 8 08:58:36 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 343CBE70; Tue, 8 Jan 2013 08:58:36 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep15.mx.upcmail.net (fep15.mx.upcmail.net [62.179.121.35]) by mx1.freebsd.org (Postfix) with ESMTP id 1EBE531F; Tue, 8 Jan 2013 08:58:34 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep15-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20130108085827.CADM2598.viefep15-int.chello.at@edge02.upcmail.net>; Tue, 8 Jan 2013 09:58:27 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge02.upcmail.net with edge id lM021k0042xdvHc01M02px; Tue, 08 Jan 2013 10:00:02 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 312526D449; Tue, 8 Jan 2013 09:58:27 +0100 (CET) Date: Tue, 8 Jan 2013 09:58:27 +0100 From: Stefan Farfeleder To: Dimitry Andric Subject: Re: clang 3.2 RC2 miscompiles libgcc? Message-ID: <20130108085826.GA1422@mole.fafoe.narf.at> References: <20121227150724.GA1431@mole.fafoe.narf.at> <50DC65F5.6060004@freebsd.org> <50E0BD66.4070609@FreeBSD.org> <20130102135950.GA1464@mole.fafoe.narf.at> <20130104154940.GD1430@mole.fafoe.narf.at> <20130106141708.GA1418@mole.fafoe.narf.at> <50E9916F.3040500@FreeBSD.org> <20130106160331.GB1418@mole.fafoe.narf.at> <50EB5868.2050509@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50EB5868.2050509@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org, David Chisnall , Nathan Whitehorn X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 08:58:36 -0000 On Tue, Jan 08, 2013 at 12:21:12AM +0100, Dimitry Andric wrote: > On 2013-01-06 17:03, Stefan Farfeleder wrote: > > On Sun, Jan 06, 2013 at 03:59:59PM +0100, Dimitry Andric wrote: > ... > > The bug also affects ports software, e.g., I also experienced strange > > rtorrent segfaults that are now gone. > > Can you please try the attached patch, which is a very horrid, atrocious > hack, and will only work for amd64. Then rebuild libgcc with clang, and > please try if this fixes at least some of the crashes... > > This is at least the direction I'm looking at. It seems that in some > cases with __builtin_eh_return(), llvm does not see that registers can > be clobbered, and it doesn't save and restore them. > > After a lot of splitting up of unwind-dw2.c, I arrived at _Unwind_Resume > which when compiled by clang caused the crashes, but when compiled by > gcc ran OK. Hi Dimitry, your patch seems to work just fine. No crashes whatsoever so far. Thank you. Stefan