public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* how to disable optimization for particular assignment statements?
@ 2013-11-21  8:22 Andrew Makhorin
  2013-11-21  8:55 ` Marc Glisse
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Makhorin @ 2013-11-21  8:22 UTC (permalink / raw)
  To: gcc-help

Hello,

I have a C code like this:

int foo(void)
{     int phase;
      . . .
      phase = 1;
      phase = 2;
      phase = 3;
      . . .
}

In case of -O0 gcc generates machine instructions for every
assignment 'phase = ...'. But in case of -O2 gcc does not generate
instructions for some assigments. Of course, this is correct. However,
is there any way to tell gcc that 'phase' object is inspected by another
thread, so it should not remove such statements?

Thank you,

Andrew Makhorin


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-22 19:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21  8:22 how to disable optimization for particular assignment statements? Andrew Makhorin
2013-11-21  8:55 ` Marc Glisse
2013-11-21  9:20   ` Marc Glisse
2013-11-23  2:48     ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).