Mail Archives: djgpp/2000/04/10/12:55:14

From: "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru>
Newsgroups: comp.os.msdos.djgpp
Subject: inefficiency of GCC output code & -O problem
Date: Mon, 10 Apr 2000 21:25:14 +0400
Organization: MTU-Intel ISP
Lines: 32
Message-ID: <>
Mime-Version: 1.0
X-Trace: 955387496 64010 (10 Apr 2000 17:24:56 GMT)
X-Complaints-To: usenet-abuse AT mtu DOT ru
NNTP-Posting-Date: 10 Apr 2000 17:24:56 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


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

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019