This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to stop gcc from not calling noinline functions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]