qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH RFC 1/2] tests/tcg: Allow targets to set the optimiz


From: David Hildenbrand
Subject: [Qemu-devel] [PATCH RFC 1/2] tests/tcg: Allow targets to set the optimization level
Date: Wed, 27 Feb 2019 12:14:10 +0100

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 <address@hidden>
---
 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 = @printf "  SKIPPED %s on $(TARGET_NAME) because 
%s\n" $1 $2
 TESTS=
 
 # Start with a blank slate, the build targets get to add stuff first
-CFLAGS=
+CFLAGS=-O0
 QEMU_CFLAGS=
 LDFLAGS=
 
@@ -70,7 +70,7 @@ ifneq ($(TARGET_BASE_ARCH),$(TARGET_NAME))
 endif
 
 # Add the common build options
-CFLAGS+=-Wall -O0 -g -fno-strict-aliasing
+CFLAGS+=-Wall -g -fno-strict-aliasing
 ifeq ($(BUILD_STATIC),y)
 LDFLAGS+=-static
 endif
-- 
2.17.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]