This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Controlling the compile within the compiled file?
- From: "Ciaran O'Riordan" <ciaran_o_riordan at hotmail dot com>
- To: shuki_sasson at hotmail dot com
- Cc: gcc-help at gnu dot org
- Date: Fri, 27 Sep 2002 03:19:00 +0000
- Subject: Re: Controlling the compile within the compiled file?
- Bcc:
From: "Shuki Sasson" <shuki_sasson@hotmail.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?
A question:
Can one instruct the gcc compiler to turn option on/off within the compiled
code?
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
Ciaran O'Riordan
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com