Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" 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 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: why won't this program compile? CC: djgpp AT delorie DOT com Precedence: bulk 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