This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: disable gcc optimization of some parts of code...
- From: Tom St Denis <tstdenis at ellipticsemi dot com>
- To: jonatan perry <jonatan44 at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 17 Oct 2007 07:49:11 -0400
- Subject: Re: disable gcc optimization of some parts of code...
- References: <d592e5da0710161300p66562615ue6c1af39354a7232@mail.gmail.com>
jonatan perry wrote:
Hi,
I have some arithmetic calculation that the GCC optimizer optimize
(e.g. a=8+8 become a=16....). who can I disable it from doing that on
some of the parts in the code? something like MACRO commands.... if
you have any other ideal I'll be happy to hear...
Factor your code so that the part you don't want optimized appears in
it's own unit (e.g. .o file) and build makefile that turns off
optimization for that object.
Alternatively, and probably more appropriate, just debug why the
optimizer is causing problems and fix the bug in your code (or report a
gcc bug).
Tom