delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/04/24/18:23:52

Date: Thu, 24 Apr 2003 16:57:01 -0500
From: Eric Rudd <rudd AT cyberoptics DOT com>
Organization: CyberOptics
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: en,pdf
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug 00314 -- div() still broken
References: <3e9c6920$0$21928$afc38c87@> <fA9pa.20115$1s1 DOT 299825 AT newsfeeds DOT bigpond DOT com> <3EA5477F DOT 2020901 AT cyberoptics DOT com> <SzSpa.21592$1s1 DOT 332473 AT newsfeeds DOT bigpond DOT com>
In-Reply-To: <SzSpa.21592$1s1.332473@newsfeeds.bigpond.com>
Lines: 31
Message-ID: <3ea85d95$0$12489$4c41069e@reader1.ash.ops.us.uu.net>
NNTP-Posting-Host: 65.214.98.62
X-Trace: 1051221397 reader1.ash.ops.us.uu.net 12489 65.214.98.62
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Ben Peddell wrote:

> Eric Rudd wrote:
>
>> I think I had some problem with -fomit-frame-pointer, but I'm still 
>> investigating.
>
> Things are being pushed wrong.
> edi is supposed to hold the address of the div_t structure, yet is has 
> 0x28 (40) in it. eax and ebx are supposed to have 40 in them, yet they 
> have -3 in them.
> div() wants the stack to look like:
>     16(%ebp): divisor
>     12(%ebp): numerator
>      8(%ebp): &return
> But it appears to look like:
>     16(%ebp): something between -2 and +2
>     12(%ebp): divisor
>      8(%ebp): numerator
>
> There in lies the problem.

This confirms my suspicion that there is a problem with 
-fomit-frame-pointer.  I thought that routines in libc.a could be called 
from a program compiled either with or without -fomit-frame-pointer, but 
I found that I could call the existing div.o in libc.a only if I didn't 
use -fomit-frame-pointer.  Hmm...

-Eric Rudd
rudd AT cyberoptics DOT com

- Raw text -


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