From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgyVm-0008GZ-5D for qemu-devel@nongnu.org; Mon, 05 Sep 2016 14:20:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgyVi-0002JG-VY for qemu-devel@nongnu.org; Mon, 05 Sep 2016 14:20:50 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:36283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgyVi-0002J5-Of for qemu-devel@nongnu.org; Mon, 05 Sep 2016 14:20:46 -0400 Received: by mail-pf0-x243.google.com with SMTP id x24so161200pfa.3 for ; Mon, 05 Sep 2016 11:20:46 -0700 (PDT) Sender: Richard Henderson References: <1473076452-19795-1-git-send-email-rabin.vincent@axis.com> <1473076452-19795-2-git-send-email-rabin.vincent@axis.com> From: Richard Henderson Message-ID: <935a11f2-8f24-a7fb-a912-0dfc0fc36ee4@twiddle.net> Date: Mon, 5 Sep 2016 11:20:42 -0700 MIME-Version: 1.0 In-Reply-To: <1473076452-19795-2-git-send-email-rabin.vincent@axis.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/9] tests: cris: fix syscall inline asm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rabin Vincent , edgar.iglesias@gmail.com Cc: qemu-devel@nongnu.org, Rabin Vincent On 09/05/2016 04:54 AM, Rabin Vincent wrote: > From: Rabin Vincent > > Add the clobbered registeres to the inline asm for the write and exit > system calls. Without the correct clobbers for the write() function, > correct failure messages are not printed succesfully on newer version of > GCC. > > Signed-off-by: Rabin Vincent > --- > tests/tcg/cris/sys.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/tests/tcg/cris/sys.c b/tests/tcg/cris/sys.c > index 551c5dd..dfa5e1c 100644 > --- a/tests/tcg/cris/sys.c > +++ b/tests/tcg/cris/sys.c > @@ -34,7 +34,10 @@ void *memset (void *s, int c, size_t n) { > > void exit (int status) { > asm volatile ("moveq 1, $r9\n" /* NR_exit. */ > - "break 13\n"); > + "break 13\n" > + : > + : > + : "r9", "memory" ); Better to simply set up the arguments properly. See http://www.uclibc-ng.org/browser/uclibc-ng/libc/sysdeps/linux/cris/bits/syscalls.h?rev=3b4650a23ff372dde44c264d43af8cfa4ac88e0a r~