Message-ID: <38F2EBD4.68D0C6DE@maths.unine.ch> Date: Tue, 11 Apr 2000 11:09:40 +0200 From: Gautier Organization: Maths - Uni =?iso-8859-1?Q?Neuch=E2tel?= X-Mailer: Mozilla 4.72 (Macintosh; I; PPC) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: inefficiency of GCC output code & -O problem References: <38F20E7A DOT 3330E9A4 AT mtu-net DOT ru> <38F2250B DOT 1DC270D5 AT maths DOT unine DOT ch> <38F22D66 DOT 42D78282 AT mtu-net DOT ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: mac13-32.unine.ch X-Trace: 11 Apr 2000 11:09:40 +0100, mac13-32.unine.ch Lines: 39 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Alexei A. Frounze": > Well, but it work with registers even when value needs to be zeroed, shifted and > so on. It loads registers in very simple situations, where possible to adjust > some bytes and we're done. What appears to me is that among a set of time-optimising variants, GCC doesn't seem to choose the most space-optimising one. But maybe the values of registers are re-used later in your code ? Some <32 bit manipulations are said to slow down a lot the Pentium-class processors. > > On Intel x86s there is not much to do - there are so few registers - but > > anyway GCC is very smart at register mapping ! > Not a few. That's enough. Well... but _compared_ to other processors the choice of registers is very poor. > I don't think GCC is a very good optimizing compiler. Anyway it has something > over other compilers: it's free, it's portble and multiplatform. There are surely improvements till reaching Watcom C or Lahey Fortran that are written with Intel code generation in mind. But who knows (with the latest ecgs & Co ?) > It always works this way. So I forced my functions to have only 32-bit > parameters and return values. This solves this ugly problem. > > You should try an equivalent test on a very > > strong typed GCC front-end like GNAT... > What's GNAT? The GNU Ada95. You can see Ada95 as a standardized Turbo Pascal with some enhancements. Since type conversions are explicit (unlike TP for the 8/16/32 bit integers), you detect the "ugly problems" at source :-). ______________________________________________________ Gautier -- http://members.xoom.com/gdemont/gsoft.htm