Xref: news2.mv.net comp.os.msdos.djgpp:4768 From: myskin AT inp DOT nsk DOT su (Vyacheslav O. Myskin) Newsgroups: comp.os.msdos.djgpp Subject: Re: Not optimizing=Crash??? Date: Fri, 07 Jun 1996 04:53:31 GMT Organization: BINP RAS Lines: 24 Distribution: world Message-ID: <4p8cka$biu@sky.inp.nsk.su> References: <1996Jun6 DOT 104656 AT zipi DOT fi DOT upm DOT es> Reply-To: myskin AT inp DOT nsk DOT su NNTP-Posting-Host: csd-bsdi.inp.nsk.su To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp a920101 AT zipi DOT fi DOT upm DOT es wrote: >I've debugged the generated code, and I've found that the problem is GCC >not passing the correct arguments to some functions. I call the function >with the correct parameter (made sure of this), but it gets a wild one! Maybe this will help somehow... Some day I've compiled a program containing movedata(_my_ds(), ...); without any optimization. _my_ds() is inline function; the compiler did not expand it properly and the linker did not report any error, using some garbage for _my_ds symbol value. The result was catastrophic (of course): the progam jumped in the middle of some function and crashed instead of pushing %ds on the stack. Maybe this happened because I had not put some nesessary switches on the command line. But everything went OK when using -O. Best wishes, V. Myskin