Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Stan Shebs'" <stan@codesourcery.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: gdbserver optimizer build failure
Date: Fri, 18 Jun 2010 22:44:00 -0000	[thread overview]
Message-ID: <001501cb0f37$d8f146e0$8ad3d4a0$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <4C1BE60D.6040208@codesourcery.com>



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Stan Shebs
> Envoyé : Friday, June 18, 2010 11:33 PM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: gdbserver optimizer build failure
> 
> Pierre Muller wrote:
> >
> >   gdbserver build currently
> > fails on gcc16 (x86-64 machine running linux).
> >
> 
> This is presumably the same problem as Doug reported a couple days ago:
> 
> http://sourceware.org/ml/gdb-patches/2010-06/msg00370.html
> 
> 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
===================================================================
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 = 1;
+
 int
 always_true (void)
 {
-  return 1;
+  return always_true_answer;
 }

 /* Our general strategy for emitting code is to avoid specifying raw



      reply	other threads:[~2010-06-18 22:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-18 20:57 Pierre Muller
2010-06-18 21:33 ` Stan Shebs
2010-06-18 22:44   ` Pierre Muller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001501cb0f37$d8f146e0$8ad3d4a0$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=stan@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox