Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: fnf@ninemoons.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Outwit compiler dead code elimination in break.exp test
Date: Mon, 01 Dec 2003 17:52:00 -0000	[thread overview]
Message-ID: <3FCB7FF9.4090601@gnu.org> (raw)
In-Reply-To: <200311292305.hATN51Uj013311@fred.ninemoons.com>

>    * as places to try setting breakpoints at.  They are explicitly
>    * "one-line functions" to verify that this case works (some versions
>    * of gcc have or have had problems with this).
> +  * Recent versions of gcc have gotten smart enough that they will not
> +  * call functions that have no use or visible side effect, so use
> +  * globalvar to outwit the compiler for a while longer.

Fred,  can you clarify exactly under what circumstances this occures?

I know that GCC will now, when -O is specified, inline (and thence 
eliminate) pure functions.  However, I don't think that should occure 
when -O isn't specified.

As for stopping GCC from eliminating code - last time this came up (ref 
store.exp) it was recommended that the .c files be split so that GCC 
couldn't see the potential optimization.

Andrew



  parent reply	other threads:[~2003-12-01 17:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-29 23:05 Fred Fish
2003-11-30  1:04 ` Fred Fish
2003-11-30  1:07   ` Daniel Jacobowitz
2003-11-30  1:26     ` Fred Fish
2003-12-01  0:46     ` Fred Fish
2003-12-01 14:58       ` Elena Zannoni
2003-12-01 15:30         ` Fred Fish
2003-12-01 15:46           ` Elena Zannoni
2003-12-01 16:39             ` Fred Fish
2003-12-01 14:23     ` Elena Zannoni
2003-12-01 14:44       ` Daniel Jacobowitz
2003-12-01 17:52 ` Andrew Cagney [this message]
2003-12-01 18:10   ` Fred Fish
2003-12-09  1:02     ` Michael Snyder
2003-12-07 21:21   ` [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch) Fred Fish
2003-12-08  0:31     ` Andrew Cagney
2003-12-01 16:55 [PATCH] Outwit compiler dead code elimination in break.exp test Michael Elizabeth Chastain
2003-12-08 23:49 [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch) Andrew Cagney
2003-12-09  5:06 ` [PATCH] Outwit compiler dead code elimination in break.exp test Fred Fish
2003-12-09  6:52 Michael Elizabeth Chastain
2003-12-29 20:20 ` Elena Zannoni

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=3FCB7FF9.4090601@gnu.org \
    --to=cagney@gnu.org \
    --cc=fnf@ninemoons.com \
    --cc=gdb-patches@sources.redhat.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