Date: Wed, 28 Jun 1995 18:19:33 +0300 From: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) To: gmoscho AT alexander DOT cc DOT ece DOT ntua DOT gr Subject: Re: optimisation... Cc: djgpp AT sun DOT soe DOT clarkson DOT edu > ps2: i allready found that -fomit-frame-pointer gets rid of the ebp/leave crap.. > no need telling me abou this... Using -fomit-frame-pointer is OK as long as you are aware of its caveats, as described in this fragment of the DJGPP FAQ list: 9.4 Q: When I run my program under Windows or another DPMI server, it crashes, but not outside of Windows, or when I add ``nodpmi'' to the GO32 environment variable. A: You may have used the "-fomit-frame-pointer" option to GCC. This tells gcc that it can use EBP as a general register. However, the selector used for the stack is protected against access outside of calculated stack range, and EBP causes that stack selector to be used. If you use this to access memory in the regular data area, you get a protection fault. This mechanism is present to prevent you from using so much stack that you begin corrupting data. Outside of Windows, or in non-DPMI mode, a different method is used to detect stack overrun, so you don't see this fault. As a general rule, don't use "-fomit-frame-pointer" when compiling DJGPP programs. If you must, you will have to tweak crt0.s to produce a custom crt0.o which under DPMI sets SS=DS.