delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/31/15:51:09

Message-Id: <m0xRIMn-000S1iC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT edu DOT ar>
Organization: INTI
To: jasonp AT Glue DOT umd DOT edu (Jason Stratos Papadopoulos)
Date: Fri, 31 Oct 1997 17:55:12 +0000
MIME-Version: 1.0
Subject: Re: why won't this program compile?
CC: djgpp AT delorie DOT com

Hi Jason:

> I guess I should be more specific. With no optimization GAs bails out
> during assembly (I think it adds extra sets of parentheses to the memory
> operands in square() and then gets confused by them). However, with -O3 it
> compiles fine. What gives?! 
You added the extra parentheses ;-)
 
> I think the reason is that with full optimization (%0) becomes (%ebp)
> -or whatever- but with anything else %0 is something like 4(%ebp) and
> the assembler chokes on (4(%ebp)). 
Yes that's the base problem.
 
> Is this on the right track? 
Yes.
> It's certainly very strange, but for another
> program I have which uses this function it won't run at all (-O2 will
> compile but running the executable gives a general protection fault.

Your fault is that you are specifying "g", that's wrong in this case because 
you are using %0 and %1 as registers so you must specify "r", this will fix 
your problem in this code.

SET 
------------------------------------ 0 --------------------------------
Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


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