Mail Archives: djgpp/1998/07/08/00:58:38
Archee/CoNTRACT wrote:
>
> hi !
>
> I use many ASM in my demos.
> When I switch on -O9 it produces a crashing exe.
> I gave only -O2, than it worked.
> What can by wrong ?
Is this regular GCC, or PGCC? PGCC is apparently unstable at very high
-O levels. For regular GCC, nothing above -O3 has any additional effect.
> How can I reach the best optimizing without any danger ?
>
> How can I use gcc with optimizing without bugz ?
Nobody knows what bugs may exist in GCC, so your questions cannot be
answered.
> What registers can I modify in an ASM code ?
In inline asm, you must inform the compiler of all registers you
clobber. In an external asm function, you can modify eax, ecx, edx, and
the FPU registers; all others must be saved and restored. Perhaps that
is the cause of your crash?
In the case of inline asm, there were a few subtle bugs in GCC 2.7.2.1;
you might upgrade to 2.8.1, if you haven't, and see if that helps.
Otherwise, compile with -S and check that the code is actually correct.
I haven't checked whether they're fixed, because I lost the test cases.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -