Mail Archives: djgpp/1999/03/08/20:50:55.1
Dave Bird wrote:
>
> In article <36e3ee80 DOT 57683257 AT newshost DOT cc DOT utexas DOT edu>, Jeramie Hicks
> <Jeramie DOT Hicks AT mail DOT utexas DOT edu> writes
> >A single inline assembly statement will typically disable all
> >compiler-based optimizations for the entire module in most C compilers
> >(since a C compiler doesn't try to understand what you're doing with
> >the inline asm). Is DJGPP this way too?
>
> No, it goes mad in the other direction.
>
> You must always tell it registers IN, OUT, and JUNKED, because every
> register you do not mention it assumes is still unchanged for
> optimisation purposes. This adds more book-keeping, but it
> works wonders for optimisation.
>
> It can also try inlining short functions which are assem, and
> (unless you mark the asm block "volatile") moving it out of loops!
Or deleting it altogether. If you don't mark it volatile, and the
compiler finds that the output values aren't used, it can go away.
This is disabled for the common case of asm blocks with no outputs
whatever, since the compiler assumes that a total lack of outputs
implies side effects, or else why write it at all?
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -