Re: [cc65] Anyway to stop optimzation of inline assembler

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-07-15 09:13:47
Hi!

On Thu, Jul 15, 2004 at 12:28:03AM -0400, Glenn Jones wrote:
> Anyway to have the compiler ignore inline assembler ... ? or turn off
> optimzations on a per file basis ?

Currently there is no way to tell the compiler to ignore inline assembler.
This is tightly coupled with handling volatile correctly (both prevent removal
or change of certain instructions), so it will probably implemented together
with this modifier.

Turning off optimizations on a per file basis is easy: Just remove -O... from
the command line when compiling the module.

If you are using the development snapshot, there's another possibility: You
can switch off optimization on a per function basis:

        #pragma optimize (push, off)
        ...
        /* Your code here */               
        ...
        #pragma optimize (pop)

Please note however, that this works only for whole functions, not for single
statements. The settings in effect when the function header is parsed
determine if the generated code will later be optmized as a whole. Placing
above #pragma inside a function will have no effect, since the current setting
is remembered when parsing the start of a function.

The new pragmas are explained in the docs in more detail.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jul 15 09:13:51 2004

This archive was generated by hypermail 2.1.8 : 2004-07-15 09:13:59 CEST