From: Gero Timann Newsgroups: comp.os.msdos.djgpp Subject: Re: inefficiency of GCC output code & -O problem Date: Mon, 10 Apr 2000 21:36:55 +0200 Organization: 1&1 Telekommunikation GmbH Lines: 44 Message-ID: <38F22D57.4A5D799B@online.de> References: <38F20E7A DOT 3330E9A4 AT mtu-net DOT ru> NNTP-Posting-Host: p3e9bdd93.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.online.de 955396150 22017 62.155.221.147 (10 Apr 2000 19:49:10 GMT) X-Complaints-To: abuse AT online DOT de NNTP-Posting-Date: 10 Apr 2000 19:49:10 GMT X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en,de,fr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi,Hi! Do you have already look at the output of the new pgcc/ecgs-gcc compiler ? (Andris Pavenis has ported this to the DJGPP-environment, downloadable from http://ieva05.lanet.lv/~pavenis/ ) Many of the awfull code-generations and C++-problems, you described, are replaced/solved now. Gero "Alexei A. Frounze" wrote: > Hi! > > 1st question... > > Why GCC output too much redundant code? > I mean, it always put values to the CPU registers, although it's possible to > make the same operation w/o taking registers? > > Also why GCC does type cast of byte/word <-> dword values so awful? It allocates > some extra bytes on the stack, put values there and get them back... > > Is it a normal thing, if one instruction that adds something to ESP(or EBP) is > followed by sutracting instruction that works with the same register? > > ... I'll find some extra info later ... > > 2nd question... > > Why the "-O2" switch works normally for pure C source code and makes compiler > failing on the source with inline assembly (in the .S file made out of such .C > an error encounters: > "Error: Error: Missing ')' assumed" > "Error: Error: Ignoring junk `(%ebp))' after expression")? > W/o the -O2 switch it's compiled fine. Isn't it a little bit strange? > > Thanks in advance. > Alexei A. Frounze > ----------------------------------------- > Homepage: http://alexfru.chat.ru > Mirror: http://members.xoom.com/alexfru