This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
compile with gcc option -O0 or -O
- From: zou wonder <wonder dot zou at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 16 Sep 2011 13:04:28 +0800
- Subject: compile with gcc option -O0 or -O
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.