Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: DoLooP , djgpp AT delorie DOT com Date: Fri, 4 Apr 1997 11:32:50 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: I don't understand djgpp's optimizations DoLooP wrote: > I'm new in c coding, and i'm trying djggp because a lot of demoscoder > says that this is THE best compiler. Not only for speed, there are other things that make DJGPP better. > So i try a simple 50000 loop with a > calcul in it. i've done a time mesure and the code generated is really > NOT speed comparing to what the watcom c gives to me. Are you using Pentium optimization in the Watcom version?, if yes, sorry but DJGPP doesn't have it yet and can make a difference. > it run 2 times better in watcom flat mode. You aren't making all OK. > i've used -o2 -forcemem -forceaddr -fstrengh... flags. Hmmm be more explicit. Use: -O2 or try if -O3 helps. -fomit-frame-pointer (be carrefull GCC have a bug regarding to the use of EBP when omit-frame-pointer is enabled, if you use EBP in your inline assembler test the generated code to see if you need to save EBP, even when you indicate that EBP was used in your inline). Pass parameters in registers if you are calling small routines inside of the loop, that can make a big difference. I don't know if -forcemem -forceaddr will help you, I don't think so. -fstrengh-reduce, try with no-strengh-reduce, can modify the situation. >(and perhaps some other one). could someone help > me ? In general GCC is very good optimizing but: 1) No Pentium optimization available yet (is under test and as a parallel development). 2) The register convention call is harder to use. SET --------------- 0 -------------------------------- Salvador Eduardo Tropea (SET). Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013