From owner-svn-src-all@freebsd.org Thu Mar 5 04:36:15 2020 Return-Path: Delivered-To: svn-src-all@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 1997925C6EB; Thu, 5 Mar 2020 04:36:15 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48XycZ5VZxz4CGM; Thu, 5 Mar 2020 04:36:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qk1-f195.google.com with SMTP id b5so4064072qkh.8; Wed, 04 Mar 2020 20:36:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QxTH7SoTW7Bxd/V+l+WqupzNN2yTXkA7EPQ2Im1yWZ0=; b=PgYqNZNHpMfLyo+yzFm6GGXeID1V4GPw1ZLXoG2tCJ3PjroRw/GIfVLLtIbTxwFwCy ufwpClp6+qNbz4624dOUgLlMfphOaoKWGbp+EfLlgQxwRkJU3CqKNlUsxj/WZ4At0toR T5wQJ/GNt9KZc8Zgyjd/7TgEVosPr5/nDpF+qrIhV9tb/Pdwkm8MZDV5AJ7rDs8NSuiX f4549C7yAok34CW3dWdTZQ5zoKXnZnk9IC5kJC71DN34gDH7liqU3xZkiBgYmhLwME+8 BUkJmL3gIeF4jfIrvUiQXRQed8dXbDKW30K1NpBGPSxVuCgX3jkYV/KrmrIpsfIz7kjN +GUw== X-Gm-Message-State: ANhLgQ0z92UQu0JvZohr98DwlkiKvwuyGW6AEYLb15j0U1s5hAKEEAiU uvC7qBXdKnZ+pl//xIJtOLI/qfic X-Google-Smtp-Source: ADFU+vsEeEAavYl2fRZV7Vwo+780kc2J+v4Xk8EEhEaFMQ5t45ShgkVJX12HLVIHY3jI+JN4aGlvIg== X-Received: by 2002:a05:620a:142b:: with SMTP id k11mr6123664qkj.322.1583382972702; Wed, 04 Mar 2020 20:36:12 -0800 (PST) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com. [209.85.160.169]) by smtp.gmail.com with ESMTPSA id y38sm15653351qth.18.2020.03.04.20.36.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Mar 2020 20:36:12 -0800 (PST) Received: by mail-qt1-f169.google.com with SMTP id 59so3231557qtb.1; Wed, 04 Mar 2020 20:36:12 -0800 (PST) X-Received: by 2002:ac8:6048:: with SMTP id k8mr5674292qtm.53.1583382971888; Wed, 04 Mar 2020 20:36:11 -0800 (PST) MIME-Version: 1.0 References: <202002281832.01SIWaEL071685@repo.freebsd.org> <5767791583138727@sas1-c7aad230fe87.qloud-c.yandex.net> <3d54ebc3-a511-a239-136d-c0f638a69351@FreeBSD.org> In-Reply-To: From: Kyle Evans Date: Wed, 4 Mar 2020 22:36:00 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r358439 - head/sys/amd64/include To: Ryan Libby Cc: Guido Falsi , "Alexander V. Chernikov" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , vbox@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48XycZ5VZxz4CGM X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.78 / 15.00]; NEURAL_HAM_MEDIUM(-0.78)[-0.779,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2020 04:36:15 -0000 On Wed, Mar 4, 2020 at 11:27 AM Ryan Libby wrote: > > On Wed, Mar 4, 2020 at 3:27 AM Guido Falsi wrote: > > > > On 02/03/20 18:13, Ryan Libby wrote: > > > On Mon, Mar 2, 2020 at 12:45 AM Alexander V. Chernikov wrote: > > >> > > >> 28.02.2020, 18:32, "Ryan Libby" : > > >>> Author: rlibby > > >>> Date: Fri Feb 28 18:32:36 2020 > > >>> New Revision: 358439 > > >>> URL: https://svnweb.freebsd.org/changeset/base/358439 > > >>> > > >>> Log: > > >>> amd64 atomic.h: minor codegen optimization in flag access > > >>> > > >>> Previously the pattern to extract status flags from inline assembly > > >>> blocks was to use setcc in the block to write the flag to a register. > > >>> This was suboptimal in a few ways: > > >>> - It would lead to code like: sete %cl; test %cl; jne, i.e. a flag > > >>> would just be loaded into a register and then reloaded to a flag. > > >>> - The setcc would force the block to use an additional register. > > >>> - If the client code didn't care for the flag value then the setcc > > >>> would be entirely pointless but could not be eliminated by the > > >>> optimizer. > > >>> > > >>> A more modern inline asm construct (since gcc 6 and clang 9) allows for > > >> This effectively restricts kernel builds by all older compilers. > > >> Is there any chance of making it conditional depending on the compiler version/features? > > > > > > Yes, it is possible to test for __GCC_ASM_FLAG_OUTPUTS__. It is more > > > maintenance effort going forward. If building current with an old cross > > > compiler is an important scenario, we can either revert this and the > > > following revision or work up a patch to make it conditional. I'll see > > > what that might look like. > > > > > > > Actually this causes emulators/virtualbox-ose port to fail to build: > > > > In file included from /usr/src/sys/sys/systm.h:44: > > /usr/include/machine/atomic.h:230:1: error: invalid output constraint > > '=@cce' in asm > > ATOMIC_CMPSET(char); > > ^ > > /usr/include/machine/atomic.h:205:4: note: expanded from macro > > 'ATOMIC_CMPSET' > > : "=@cce" (res), /* 0 */ \ > > ^ > > /usr/include/machine/atomic.h:230:1: error: invalid output constraint > > '=@cce' in asm > > > > (and so on) > > > > > > the virtualbox-ose port is forced to use an older clang version due to > > crashes when compiled with newer ones. > > > > Not sure whose responsibility is to fix this. > > > > Should I file a bug report on bugzilla? > > > > -- > > Guido Falsi > > We've discussed whether to provide compatibility code for older compilers here: > https://reviews.freebsd.org/D23937 > > There's a bug tracking virtualbox-ose being pinned to an old compiler here: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236616 > > I see you have commented on that bug. I've opened https://reviews.freebsd.org/D23967 and PR 244603 specifically for coercing the port to use GCC9 instead, which does indeed fix the breakage. Once that lands, I'll investigate 236616 some more to see if newer llvm (including 10) is still broken here. Thanks, Kyle Evans