www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/14/13:10:12

From: "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: inefficiency of GCC output code & -O problem
Date: Fri, 14 Apr 2000 20:52:32 +0400
Organization: MTU-Intel ISP
Lines: 36
Message-ID: <38F74CD0.6987E15A@mtu-net.ru>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000413112851 DOT 28180G-100000 AT is> <38F6137B DOT 47481761 AT mtu-net DOT ru> <8d76dk$dg5$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: ppp96-173.dialup.mtu-net.ru
Mime-Version: 1.0
X-Trace: gavrilo.mtu.ru 955731546 49909 212.188.96.173 (14 Apr 2000 16:59:06 GMT)
X-Complaints-To: usenet-abuse AT mtu DOT ru
NNTP-Posting-Date: 14 Apr 2000 16:59:06 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 of all, thanks.

Hans-Bernhard Broeker wrote:
> Technically spoken, I think we're in the regime of 'undefined
> behaviour', here, i.e. with your example code, absolutely anything can
> happen, from 'it works as expected' all the way to a crash of the
> compiler, or even worse things.

Okay, I mean exactly what you talk here. But why "undefined"??? Compiler must
have difined behaviour or a list of *different valid* ways that get you to the
target.
I'm simply disappointed because of this behaviour. I've never had such problems
with other compilers (Borland Pascal/C, Warcom C). And I couldn't figure out
that I would have them.

> Inline assembly is definitely expert-level stuff. This implies that
> gcc has to assume the programmer knows what (s)he's doing, there.  It
> cannot check this code itself, in all cases, so it's up to you to
> check it. Please don't take this as an offence, but I think this
> discussion has shown that you do not have all the necessary expertise
> yet, in that area.

Well, I might have insufficient experience with GCC, but I couldn't figure out
that inline assembly is too difficult with GCC. As I mentioned before, I've
never had such or similar problems with other compilers.

Simply don't get me wrong. GCC inline assembly seems the most unusual thing for
me. And running into the "undefined behaviour" problems is shocking.

Thanks.
Alexei A. Frounze
-----------------------------------------
Homepage: http://alexfru.chat.ru
Mirror:   http://members.xoom.com/alexfru


- Raw text -


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