From nobody Sun Nov 9 17:49:32 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551267358289940.0210419327448; Wed, 27 Feb 2019 03:35:58 -0800 (PST) Received: from localhost ([127.0.0.1]:42409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyxV2-00054l-M5 for importer@patchew.org; Wed, 27 Feb 2019 06:35:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyxP5-0000bC-BF for qemu-devel@nongnu.org; Wed, 27 Feb 2019 06:29:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyxAJ-0006Ik-6L for qemu-devel@nongnu.org; Wed, 27 Feb 2019 06:14:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37742) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyxAI-0006I3-Vw; Wed, 27 Feb 2019 06:14:19 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 25E103132C42; Wed, 27 Feb 2019 11:14:18 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-104.ams2.redhat.com [10.36.117.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7792E2B46F; Wed, 27 Feb 2019 11:14:16 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Wed, 27 Feb 2019 12:14:10 +0100 Message-Id: <20190227111411.22890-2-david@redhat.com> In-Reply-To: <20190227111411.22890-1-david@redhat.com> References: <20190227111411.22890-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 27 Feb 2019 11:14:18 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFC 1/2] tests/tcg: Allow targets to set the optimization level X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We sometimes want basic optimizations, e.g. for constant propagation into inlined functions. Especially for inline asm with immediates; static inline void some_instr(uint8_t imm) { asm volatile("...", :: "i" (imm)); } static void test() { some_instr(1); } Which is impossible with -O0. So make -O0 the default but let targets override it. Signed-off-by: David Hildenbrand --- tests/tcg/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index bf06415390..bd0bace0d5 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -47,7 +47,7 @@ skip-test =3D @printf " SKIPPED %s on $(TARGET_NAME) bec= ause %s\n" $1 $2 TESTS=3D =20 # Start with a blank slate, the build targets get to add stuff first -CFLAGS=3D +CFLAGS=3D-O0 QEMU_CFLAGS=3D LDFLAGS=3D =20 @@ -70,7 +70,7 @@ ifneq ($(TARGET_BASE_ARCH),$(TARGET_NAME)) endif =20 # Add the common build options -CFLAGS+=3D-Wall -O0 -g -fno-strict-aliasing +CFLAGS+=3D-Wall -g -fno-strict-aliasing ifeq ($(BUILD_STATIC),y) LDFLAGS+=3D-static endif --=20 2.17.2