www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/08/17:47:37

From: igp AT vlc DOT servicom DOT es (Ignacio García Pérez)
Newsgroups: comp.os.msdos.djgpp
Subject: Help: -O3 breaks my code
Date: Thu, 08 Oct 1998 17:48:35 GMT
Organization: GND
Lines: 30
Message-ID: <361cf8ae.10692665@crispin>
NNTP-Posting-Host: rdsi53.vlc.servicom.es
Mime-Version: 1.0
X-Newsreader: Forte Agent 1.01/32.397
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi, programmers:

I've got a small problem with DJGPP: when I compile my program with
-O2 works perfect, when I compile it with -O3 it blows away. It also
blows away with "-O2 -finline-functions" which I believe is exactly
the same than "-O3", so the problem is in the inlining of relatively
small finctions.

I've isolated the problem in my serial communications library. As you
may imagine, it hooks an interrupt vector. The interrupt wrapper is in
a separate file which does not have problems with -O3, and before you
point it out, I lock all the required variables and code, and anywat
I've also tried to compile with 

"int _crt0_startup_flags=_CRT0_FLAG_LOCK_MEMORY", and moreover if
locking was the problem the hangups would happen seldom, with low
memory conditions (when the program memory is paged out).

If anyone can provide any useful clues, I'll be gratly grateful.

Also, is there any way I can enable/disable the inline-functions
optimizations inside a file. I would enable it partially in the
communications library in order to isolate the section that causes the
problem.

Thanks in advance. Nacho.




- Raw text -


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