This is the mail archive of the gcc-help@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]

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.


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