public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compile with gcc option -O0 or -O
@ 2011-09-16  5:04 zou wonder
  2011-09-16  5:41 ` Ian Lance Taylor
  0 siblings, 1 reply; 14+ messages in thread
From: zou wonder @ 2011-09-16  5:04 UTC (permalink / raw)
  To: gcc-help

HI guys:
 i am compiling codes with gcc4.4.4 :

but one weird problem is that the following codes compiled with option -O0

, then the logic could works well.

static BOOLE
tc_user_info_is_present
(
     VARIABLE_STR *var,
     VTASK        *task
)
{
   BOOLE result;

   if (mapIs_user_information(mapAsn)){
     result = 1;
   }
   else
   {
     result = 0;
   }
   return result;
}
but compiled with -O the codes could not work well.

but when i add some Trace in the code, compiled with -O , could also work well.


static BOOLE
tc_user_info_is_present
(
     VARIABLE_STR *var,
     VTASK        *task
)
{
   BOOLE result;

   if (mapIs_user_information(mapAsn)){
   XMM_ERROR("USER INFO SET");
     result = 1;
   }
   else
   {
    XMM_ERROR("USER INFO NOT SET");
     result = 0;
   }
   return result;
}

so my question is the what's the difference between the two options.

what's wrong with my program.

and the program is compiled in 64bit linux with -m32 option

thanks.

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

end of thread, other threads:[~2011-09-21  2:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-16  5:04 compile with gcc option -O0 or -O zou wonder
2011-09-16  5:41 ` Ian Lance Taylor
2011-09-16  7:10   ` David Brown
2011-09-16  7:54     ` Miles Bader
2011-09-16  9:21       ` David Brown
2011-09-16 10:06         ` Miles Bader
2011-09-16 10:35           ` David Brown
2011-09-16  8:27     ` Jeffrey Walton
     [not found]   ` <CAOXjUBzK0snvjNcpi8D3mK5dmXwzH62XXETyjv+4f6S+LDmXyQ@mail.gmail.com>
     [not found]     ` <CAOXjUBwW2ghmfsF1OA5DY7hZOz-43r22biSG60VyWaviFau_-Q@mail.gmail.com>
     [not found]       ` <mcrfwjx6lrk.fsf@coign.corp.google.com>
2011-09-16  9:12         ` zou wonder
2011-09-16  9:32           ` David Brown
2011-09-16  9:47           ` Jonathan Wakely
2011-09-19  9:57             ` zou wonder
2011-09-19 10:32               ` David Brown
2011-09-21  2:18               ` zou wonder

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).