From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15759 invoked by alias); 20 Jun 2010 20:36:51 -0000 Received: (qmail 15750 invoked by uid 22791); 20 Jun 2010 20:36:50 -0000 X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,RCVD_IN_JMF_BL X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Jun 2010 20:36:45 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o5KKaEqv036549 ; Sun, 20 Jun 2010 22:36:15 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms7.u-strasbg.fr [IPv6:2001:660:2402:d::16]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o5KKaD5p021547 ; Sun, 20 Jun 2010 22:36:13 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o5KKa3e8018738 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Sun, 20 Jun 2010 22:36:04 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: , "'Doug Evans'" Cc: "'Hui Zhu'" , , "'Pedro Alves'" , "'Stan Shebs'" , "'Eli Zaretskii'" , "'Michael Snyder'" References: <201006071700.28706.pedro@codesourcery.com> <4C19222C.2000208@codesourcery.com> <201006162016.18181.pedro@codesourcery.com> <4C19265B.7090502@codesourcery.com> <4C1A6362.3020306@vmware.com> <-3945058798826177264@unknownmsgid> In-Reply-To: Subject: RE: [RFA-new version][gdbserver] x86 agent expression bytecode compiler (speed up conditional tracepoints) Date: Sun, 20 Jun 2010 20:36:00 -0000 Message-ID: <004b01cb10b8$3be5e4a0$b3b1ade0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00448.txt.bz2 This patch fixes compilation on gcc16. May I commit this? Pierre gdbserver/ChangeLog entry: 2010-06-20 Ian Lance Taylor Pierre Muller * linux-x86-low.c (always_true): Delete function. (EMIT_ASM, EMIT_ASM32): Use `do ... while (0)' to avoid code been optimzed out. Index: src/gdb/gdbserver/linux-x86-low.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/linux-x86-low.c,v retrieving revision 1.19 diff -u -p -r1.19 linux-x86-low.c --- src/gdb/gdbserver/linux-x86-low.c 15 Jun 2010 10:44:48 -0000 1.19 +++ src/gdb/gdbserver/linux-x86-low.c 20 Jun 2010 06:25:07 -0000 @@ -1484,14 +1484,6 @@ add_insns (unsigned char *start, int len current_insn_ptr = buildaddr; } -/* A function used to trick optimizers. */ - -int -always_true (void) -{ - return 1; -} - /* Our general strategy for emitting code is to avoid specifying raw bytes whenever possible, and instead copy a block of inline asm that is embedded in the function. This is a little messy, because @@ -1499,26 +1491,20 @@ always_true (void) code, plus suppress various warnings. */ #define EMIT_ASM(NAME,INSNS) \ - { extern unsigned char start_ ## NAME, end_ ## NAME; \ + do { extern unsigned char start_ ## NAME, end_ ## NAME; \ add_insns (&start_ ## NAME, &end_ ## NAME - &start_ ## NAME); \ - if (always_true ()) \ - goto skipover ## NAME; \ __asm__ ("start_" #NAME ":\n\t" INSNS "\n\tend_" #NAME ":\n\t"); \ - skipover ## NAME: \ - ; } + ; } while (0) #ifdef __x86_64__ #define EMIT_ASM32(NAME,INSNS) \ - { extern unsigned char start_ ## NAME, end_ ## NAME; \ + do { extern unsigned char start_ ## NAME, end_ ## NAME; \ add_insns (&start_ ## NAME, &end_ ## NAME - &start_ ## NAME); \ - if (always_true ()) \ - goto skipover ## NAME; \ __asm__ (".code32\n\tstart_" #NAME ":\n\t" INSNS "\n\tend_" #NAME ":\n" \ "\t.code64\n\t"); \ - skipover ## NAME: \ - ; } + ; } while (0) #else