From owner-freebsd-stable@FreeBSD.ORG Tue Dec 23 04:20:55 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 941EE839 for ; Tue, 23 Dec 2014 04:20:55 +0000 (UTC) Received: from dyslexicfish.net (dyslexicfish.net [91.109.5.35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1819366F96 for ; Tue, 23 Dec 2014 04:20:54 +0000 (UTC) Received: from dyslexicfish.net (dyslexicfish.net [91.109.5.35]) by dyslexicfish.net (8.14.5/8.14.5) with ESMTP id sBN4Ji8M030263; Tue, 23 Dec 2014 04:19:44 GMT (envelope-from jamie@dyslexicfish.net) Received: (from jamie@localhost) by dyslexicfish.net (8.14.5/8.14.5/Submit) id sBN4JhKA030262; Tue, 23 Dec 2014 04:19:43 GMT (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <201412230419.sBN4JhKA030262@dyslexicfish.net> Date: Tue, 23 Dec 2014 04:19:43 +0000 To: freebsd@omnilan.de, freebsd-stable@freebsd.org Subject: Re: CPUTYPEs includig avx are suspicious with clang in stable/10 References: <54944D08.8000202@omnilan.de> In-Reply-To: <54944D08.8000202@omnilan.de> User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (dyslexicfish.net [91.109.5.35]); Tue, 23 Dec 2014 04:19:44 +0000 (GMT) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2014 04:20:55 -0000 Harry Schmalzbauer wrote: > I'm seeing sporadic problems (core dumps) with binaries compiled with > CPUTYPE=core-i-avx. > They run fine on IvyBridge, but fail on Haswells. > Stripping avx from MACHINE_CPU (by defining CPUTYPE=corei7 instead of > core-i-avx) solved all crashes on the haswell system. I wonder if it's the same problem I've encountered with a KVM virtual host? In this case, the fault was BMI (BMI2 is ok) I never isolated the cause - my BMI tests worked ok with clang (though they were direct calls to the BMI family, rather than 'stuff clang could use BMI Op-codes stuff for") Maybe you could try with -mno-bmi ? My details: FreeBSD 10.1-PRERELEASE #0: Sun Nov 9 10:07:32 GMT 2014 root@catseye.dyslexicfish.net:/usr/obj/usr/src/sys/CATSEYE amd64 FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 CPU: Vultr Virtual CPU 2 (3392.29-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x306c1 Family = 0x6 Model = 0x3c Stepping = 1 Features=0x178bfbfd Features2=0x9ffa3203 AMD Features=0x28100800 AMD Features2=0x1 Structured Extended Features=0xf38\nint main()\n{\nprintf ("boo");\n}\n' | /usr/bin/cc -v -x c -march=native -fsyntax-only -o /dev/null - 2>&1 | awk '($1 == "\"/usr/bin/cc\"") {printf "\n%s\n\n", $0; sub ("^.* -target-cpu ",""); sub (" .*$", ""); print "Clang \"native\" target for this machine: " $0} ($1 == "error:")' "/usr/bin/cc" -cc1 -triple x86_64-unknown-freebsd10.1 -fsyntax-only -disable-free -disable-llvm-verifier -main-file-name - -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu core-avx2 -v -resource-dir /usr/bin/../lib/clang/3.4.1 -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gnustep -fdiagnostics-show-option -vectorize-slp -x c - Clang "native" target for this machine: core-avx2 3:21 [2] (9) "/tmp" jamie@catseye% A full test for me shows this works OK: -mtune=core-avx2 -march=core-avx2 -mmmx -msse -msse2 -msse3 -mpclmul -mssse3 -mfma -mcx16 -msse4.1 -msse4.2 -mpopcnt -maes -mavx -mno-bmi -mavx2 -mbmi2 -mrtm (note -mno-nbmi instead of -mbmi) Cheers, Jamie