delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/10/16:48:31

From: wmcgugan AT netcomuk DOT co DOT uk (William McGugan)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Crashes with -O
Date: Sat, 10 May 1997 19:14:06 GMT
Organization: None. (via NETCOM Internet Ltd. USENET service).
Lines: 21
Message-ID: <33416b32.165818@nntp.netcomuk.co.uk>
References: <33407c18 DOT 79366 AT nntp DOT netcomuk DOT co DOT uk>
NNTP-Posting-Host: dialup-17-07.netcomuk.co.uk
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sat, 10 May 1997 02:09:58 GMT, wmcgugan AT netcomuk DOT co DOT uk (William
McGugan) wrote:

>I have a function that crashes with the -O switch set (any value).
>What could cause that, and how can I cure it?
>

Problem solved :)

I had a loop that changed some global variables and called an
assembler function that used these global variables. I think that when
the optimizations were on the compiler used registers instead of
memory references, so the correct values were in registers and not in
memory where the assembler function expected them to be. 

Of course, I'm only guessing but I coded the loop completely in
assembler and everything works fine now.


William McGugan.
http://www.netcomuk.co.uk/~wmcgugan

- Raw text -


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