From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24733 invoked by alias); 18 Jun 2010 22:44:50 -0000 Received: (qmail 24723 invoked by uid 22791); 18 Jun 2010 22:44:49 -0000 X-SWARE-Spam-Status: No, hits=1.1 required=5.0 tests=AWL,BAYES_20,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.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Jun 2010 22:44: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 o5IMich4034621 ; Sat, 19 Jun 2010 00:44:38 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms8.u-strasbg.fr [IPv6:2001:660:2402:d::17]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o5IMicei046158 ; Sat, 19 Jun 2010 00:44:38 +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 o5IMibK1019459 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Sat, 19 Jun 2010 00:44:37 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Stan Shebs'" Cc: References: <000f01cb0f28$e3d8b610$ab8a2230$@muller@ics-cnrs.unistra.fr> <4C1BE60D.6040208@codesourcery.com> In-Reply-To: <4C1BE60D.6040208@codesourcery.com> Subject: RE: gdbserver optimizer build failure Date: Fri, 18 Jun 2010 22:44:00 -0000 Message-ID: <001501cb0f37$d8f146e0$8ad3d4a0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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/msg00424.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Stan Shebs > Envoy=E9=A0: Friday, June 18, 2010 11:33 PM > =C0=A0: Pierre Muller > Cc=A0: gdb-patches@sourceware.org > Objet=A0: Re: gdbserver optimizer build failure >=20 > Pierre Muller wrote: > > > > gdbserver build currently > > fails on gcc16 (x86-64 machine running linux). > > >=20 > This is presumably the same problem as Doug reported a couple days ago: >=20 > http://sourceware.org/ml/gdb-patches/2010-06/msg00370.html >=20 > It doesn't happen to me, probably because it only kicks in on > particular > compiler / binutils combos. But could you please try Ian's suggested > macro in http://sourceware.org/ml/gdb-patches/2010-06/msg00379.html ? > It looks like it would do the right thing. No that patch didn't work on gcc16, apparently the optimizer still skips the "unsused" code. The following worked for gcc16: I first added the volatile to the variable, but it did not seem to be required. Pierre Index: linux-x86-low.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 --- linux-x86-low.c 15 Jun 2010 10:44:48 -0000 1.19 +++ linux-x86-low.c 18 Jun 2010 22:41:59 -0000 @@ -1486,10 +1486,13 @@ add_insns (unsigned char *start, int len /* A function used to trick optimizers. */ + +/* volatile */ int always_true_answer =3D 1; + int always_true (void) { - return 1; + return always_true_answer; } /* Our general strategy for emitting code is to avoid specifying raw