Mail Archives: djgpp/1997/10/31/15:51:09
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 -