Controlling the compile within the compiled file?
Thu Sep 26 20:19:00 GMT 2002
>From: "Shuki Sasson" <email@example.com>
>Hi all, I came across a problem with the optimizer (-O option) the -O0
>option get rid of the problem.
what is the problem with the optimizer?
>Can one instruct the gcc compiler to turn option on/off within the compiled
No. Optimisation is a one-way function.
If you have an expression in your code "(1 + 1)" the optimiser will
replace this with "2". The compiled program does not know that the
programmer typed "(1 + 1)". I know your talking about more complex
code but the principle is the same.
You'll have to recompile if you want to change the optimisations.
If the problem occurs when you use "gcc -O", try -O2, -O3 or -Os.
If the problem doesn't go away try specifying the optimisation
switches yourself i.e. gcc -fforce-mem -fomit-frame-pointer (etc.)
Hope this helps
Chat with friends online, try MSN Messenger: http://messenger.msn.com
More information about the Gcc-help