www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/06/13:38:55

Sender: nate AT cartsys DOT com
Message-ID: <35F2BF67.5EE4EF08@cartsys.com>
Date: Sun, 06 Sep 1998 09:59:19 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Endlisnis <s257m AT unb DOT ca>
CC: djgpp AT delorie DOT com
Subject: Re: Bug in GCC?
References: <35F296C8 DOT EE7B49C7 AT unb DOT ca>

Endlisnis wrote:
> 
> The program doesn't compile as I would expect.  All it was spose to do is
> show how you could use inline asm to add 2 integers.  But, the return value
> was always 4.  So I looked at the asm code generated for the function, it
> reads from port 0x83 and does some loops and stuff.  All I wanted was 1 add.
>         And the debugger (when the asm window is open) can't debug it right.  It
> skips lines and weird things happen, registers change values without any
> obvious reason.
> 
> Note: Moving the function after the main makes GCC compile it as expected.  I
> am using DJGPP v2.8.1 from RHIDE with "-Wall" and "-g" on, nothing else.
> Also, I've tried compiling it on a different machine with the same results.

That is extraordinarily bizarre.  Could you:

* Find out *exactly* what switches RHIDE invokes GCC with.
* Post the complete asm produced.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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