From owner-freebsd-toolchain@FreeBSD.ORG Sat Sep 13 18:30:46 2014 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05B0F816; Sat, 13 Sep 2014 18:30:46 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 678369FB; Sat, 13 Sep 2014 18:30:45 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::b12a:a821:10d9:98f3] (unknown [IPv6:2001:7b8:3a7:0:b12a:a821:10d9:98f3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1045BB803; Sat, 13 Sep 2014 20:30:38 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_FD0B8BBC-223F-4B45-8F17-6B995FBDE8C9"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: clang makes segfaulting code with -march=core2 on i386 From: Dimitry Andric In-Reply-To: <5414865A.6030101@freebsd.org> Date: Sat, 13 Sep 2014 20:30:12 +0200 Message-Id: References: <54130AD0.8090103@freebsd.org> <54133E1E.9030105@freebsd.org> <54135B24.5040905@freebsd.org> <54135D0B.7060701@freebsd.org> <6FDF432B-8245-4BC7-952B-DFFEEA106D6F@FreeBSD.org> <5414865A.6030101@freebsd.org> To: Andrey Chernov X-Mailer: Apple Mail (2.1878.6) Cc: 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: Sat, 13 Sep 2014 18:30:46 -0000 --Apple-Mail=_FD0B8BBC-223F-4B45-8F17-6B995FBDE8C9 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=koi8-r On 13 Sep 2014, at 20:00, Andrey Chernov wrote: > On 13.09.2014 20:45, Dimitry Andric wrote: >> After some massaging of gcc's source to disable its built-in segfault >> handlers, I get this backtrace: > > Do you get this with my core or finally able to reproduce it by yourself? I was able to reproduce it, on stable/10. I could not reproduce it on head, but that is how it sometimes goes with this kind of issue. :) >> I think it's most likely this is some type of undefined behavior in gcc, >> which leads to randomly corrupted tree values. Of course, it could also >> be a clang bug, but I don't see any "64-bit" instructions in there at >> all. >> >> This needs to be investigated further, but it's very hard to understand >> what is going on the guts of gcc's parser. Let alone to reduce this to >> some sort of reproducible test case. > > By first glance I see a lots of things. It is known that > in edge cases gcc preserves more "unused" values than clang. It can be > the possible case. I'll try to lower -O level preserving -march=core2 > and see. It seems to work for me with -O1 -march=core2, and while valgrind does complain a little, the warnings are all benign. I'll see if I can "mix and match" a few -O2 and -O1 compiled objects, to zero in on where the problematic area(s) are. -Dimitry --Apple-Mail=_FD0B8BBC-223F-4B45-8F17-6B995FBDE8C9 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.22 (Darwin) iEYEARECAAYFAlQUjUgACgkQsF6jCi4glqMLcQCePX11qOw/Gh+jUTUzCw4iV0DK URYAoJKWrTC0w3eXhnxzLsJgvdg7s9os =IAJV -----END PGP SIGNATURE----- --Apple-Mail=_FD0B8BBC-223F-4B45-8F17-6B995FBDE8C9--