From owner-freebsd-current@freebsd.org Sat Sep 26 15:48:46 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65A444222C1 for ; Sat, 26 Sep 2020 15:48:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzCqy0hxkz3VGH; Sat, 26 Sep 2020 15:48:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id D6BAF279C5; Sat, 26 Sep 2020 15:48:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::1541:df91:ecb9:de76] (unknown [IPv6:2001:470:7a58:0:1541:df91:ecb9:de76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 8AB5A30CF; Sat, 26 Sep 2020 17:48:44 +0200 (CEST) From: Dimitry Andric Message-Id: <6AA016B6-EEAC-4580-B7F0-9D274ADA9E73@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_6C302055-441C-4F4A-9B7C-EC1B2E1846F6"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: clang build buggy code with certain CPUTYPE setting Date: Sat, 26 Sep 2020 17:48:33 +0200 In-Reply-To: <20200926114045.GA31128@plan-b.pwste.edu.pl> Cc: freebsd-current@freebsd.org To: Marek Zarychta References: <20200926114045.GA31128@plan-b.pwste.edu.pl> X-Mailer: Apple Mail (2.3445.104.17) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 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: Sat, 26 Sep 2020 15:48:46 -0000 --Apple-Mail=_6C302055-441C-4F4A-9B7C-EC1B2E1846F6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 26 Sep 2020, at 13:40, Marek Zarychta = wrote: >=20 > I have done a few builds of CURRENT in a row one or two weeks apart. = The > builds with CPUTYPE?=3Damdfam10 set produce buggy code, for example = while > running mergemaster I get this error: >=20 > PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and > include the crash backtrace, preprocessed source, and associated run > script. > Stack dump: > 0. Program arguments: cc --version > #0 0x00000000040ede6e (/usr/bin/cc+0x40ede6e) > #1 0x00000000040ec0e5 (/usr/bin/cc+0x40ec0e5) > #2 0x00000000040ee550 (/usr/bin/cc+0x40ee550) > #3 0x000000080553babe (/lib/libthr.so.3+0x19abe) > Illegal instruction > make: "/usr/src/share/mk/bsd.compiler.mk" line 181: Unable to = determine > compiler type for CC=3Dcc. Consider setting COMPILER_TYPE. >=20 > The 13-CURRENT world built without CPUTYPE runs fine, the same for > recent 12.2-STABLE world build with CPUTYPE?=3Damdfam10 on the same > machine. Hi Marek, In r365507 (on 2020-09-09) I committed a fix for amdfam10: ------------------------------------------------------------------------ r365507 | dim | 2020-09-09 20:11:04 +0200 (Wed, 09 Sep 2020) | 17 lines Merge commit e6bb4c8e7 from llvm git (by Craig Topper): [X86] SSE4_A should only imply SSE3 not SSSE3 in the frontend. SSE4_1 and SSE4_2 due imply SSSE3. So I guess I got confused when switching the code to being table based in D83273. Fixes PR47464 This should fix builds with -march=3Damdfam10 emitting SSSE3 = instructions such as pshufb, which lead to programs crashing with SIGILL on such processors. Reported by: avg MFC after: 6 weeks X-MFC-With: r364284 So I expect that the "Illegal instruction" you are seeing is an SSSE3 instruction. If this happens with your base compiler, please get a known-good copy from one of the snapshot images. Ensure your /usr/src is r365507 or later, then do a full buildworld and reinstall. -Dimitry --Apple-Mail=_6C302055-441C-4F4A-9B7C-EC1B2E1846F6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iFwEARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCX29i0gAKCRCwXqMKLiCW o9GbAJYiNkXYA4MMCdi1DQ7JPi+S9TUJAKDw8QLjUFqT5ntPcuLEDqCO6rOtXg== =HBEa -----END PGP SIGNATURE----- --Apple-Mail=_6C302055-441C-4F4A-9B7C-EC1B2E1846F6--