This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to stop gcc from not calling noinline functions
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 06 Feb 2008 15:59:21 -0800
- Subject: Re: How to stop gcc from not calling noinline functions
- References: <200801120620.m0C6K3p1013168@ignucius.se.axis.com> <84fc9c000801120322w21679354v187fa80d2a262bc7@mail.gmail.com>
Richard Guenther wrote:
You can apart from the other suggestions also mark the function weak
which will prevent both inlining and pure/const analysis.
How about just writing to a volatile variable from within the callee?
void f() __attribute__((noinline)) {
volatile int i;
i = 3;
}
void g() {
f();
}
A valid GNU C compiler cannot eliminate the call to "f", as long as the
call itself is reachable.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713