From 7515c32c1f005b65b55eb5b6e8d46968829eb563 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 29 May 2009 01:17:53 +0000 Subject: [PATCH] Not sure, if this was only a gcc 4.3.3 bug or if I misunderstand something, but gcc could apparently assume that the register assigned to the one in the clobber list would keep its value (as can be observed when disassembling add_debugger_command_etc()). Using a dummy output register works around the problem and also avoids the unnecessary initialization of the register. Comments explaining the mystery welcome. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30909 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/x86/arch_int.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/private/kernel/arch/x86/arch_int.h b/headers/private/kernel/arch/x86/arch_int.h index d1eeee4b97..b012eefad7 100644 --- a/headers/private/kernel/arch/x86/arch_int.h +++ b/headers/private/kernel/arch/x86/arch_int.h @@ -35,12 +35,12 @@ arch_int_restore_interrupts_inline(int oldstate) int flags = oldstate ? 0x200 : 0; asm volatile("pushfl;\n" - "popl %1;\n" - "andl $0xfffffdff,%1;\n" - "orl %0,%1;\n" - "pushl %1;\n" + "popl %0;\n" + "andl $0xfffffdff,%0;\n" + "orl %1,%0;\n" + "pushl %0;\n" "popfl\n" - : : "r" (flags), "r" (0)); + : "=&r"(flags) : "r"(flags)); }