From: "Alexei A. Frounze" Newsgroups: comp.os.msdos.djgpp Subject: Re: inefficiency of GCC output code & -O problem Date: Wed, 12 Apr 2000 00:01:35 +0400 Organization: MTU-Intel ISP Lines: 44 Message-ID: <38F3849F.D8E341B4@mtu-net.ru> 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> <38F2EBD4 DOT 68D0C6DE AT maths DOT unine DOT ch> NNTP-Posting-Host: ppp104-221.dialup.mtu-net.ru Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Trace: gavrilo.mtu.ru 955483625 76853 212.188.104.221 (11 Apr 2000 20:07:05 GMT) X-Complaints-To: usenet-abuse AT mtu DOT ru NNTP-Posting-Date: 11 Apr 2000 20:07:05 GMT X-Mailer: Mozilla 4.61 [en] (Win95; I) X-Accept-Language: en,ru To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Gautier wrote: > > "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. No, they are not used. At least these registers are filled in with other data immediately after that. So... :) > > > > 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. The most awful problem is insufficiency of RAM and stack. Intel C51 microcontroller has 8 (one-byte) registers. That's enough. But it has only 128 bytes of RAM... :) > > 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 :-). Pascal is enough for me. I'll probably program in Delphi (visual version of object pascal for Win32) for the 1st time. Then I'll try C++ for the same tasks. bye. Alexei A. Frounze ----------------------------------------- Homepage: http://alexfru.chat.ru Mirror: http://members.xoom.com/alexfru