On Tue, 10 Jul 2007 13:13:12 +0200, Hector Martin wrote: >peter green wrote: >> IIRC C18 disables ALL optimisation in a function if you use any inline >> assembler in it. I wonder if you are running into that issue. >That's lame. Even so, it's not the issue. I wasn't using any inline asm. > Compiler optimizations are performed based on the compiler's knowledge of the state of things within the function. Since the compiler can't "know" what any assembler code is doing inside the function, it has to invalidate all of its assumptions. That's what actually disables the optimizations. There are some C18 macros which insert inline assembler even though they don't appear to. Two that come to mind are Nop() and ClrWdt(). I'm sure that there are a few more. Regards, Bob -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist