Xref: utzoo comp.sys.amiga:34869 comp.sys.amiga.tech:5507 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!eos!phil From: phil@eos.UUCP (Phil Stone) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: Lattice C 5.02 Message-ID: <3859@eos.UUCP> Date: 5 Jun 89 16:40:52 GMT References: <8906041609.AA24115@ucbvax.Berkeley.EDU> Reply-To: phil@eos.UUCP (Phil Stone) Followup-To: comp.sys.amiga.tech Organization: NASA Ames Research Center, Calif. Lines: 66 In article <8906041609.AA24115@ucbvax.Berkeley.EDU> 11TSTARK@GALLUA.BITNET (Timothy Stark) writes: > I have another problems. My program kept to get a visit from GURU. >I cannot find a bug in my source file. I decided to put debug information >at starting routines. When it hits GURU, I get last information from >debug routines. I looked into my source file but I still unable to find >a bug. It must be a bug in compiler which generate incorrect instructions. >It may results as illegal instruction, A emulation, or F emulation GURUs >with task address (.000032D2 -- I am not sure that). What do I do next? > >-- Tim Stark (Note: I'm responding to comp.sys.amiga so Tim will see this answer, but I think the topic is more appropriate to the .tech group, so follups are directed there). Tim, I assume you have CodeProbe with your Lattice 5.0. You can use this to single-step through suspected problem areas in your code; often this will enable you to see where the crash occurs. However, this is not always enlightening. Am I crazy, or are there some significant code-generation bugs in Lattice 5.02? Here's a brief code fragment-example: I have a structure defined as follows: struct foo { unsigned short shortbar; unsigned char bar2; unsigned char bar3; }; In a certain function, the following code occurs: struct foo *fooptr; unsigned short temp; . . . fooptr->bar2++; if( fooptr->shortbar != 0xFFFF ) fooptr->shortbar = temp; fooptr++; . . . Looking at this area of the code with CPR, I noticed that the generated assembly code incremented 'fooptr' into the MIDDLE of the next structure (a simple wordwise increment, rather than the addition of 4 bytes that is required). Certain tweaking, like changing the unsigned short field to an 'int' field, made the problem go away. But this seems to be a strange problem which was not generated from the same source using Lattice 3.01 (my previous version). What gives? Do y'all need more detail on this? Also, I haven't tried the Lattice on-line support; is this indicated? Again, notice that followups have been directed to comp.sys.amiga.tech. Phil Stone (phil@eos.arc.nasa.gov | ames!eos!phil)