Path: chuka.playstation.co.uk!news From: laura smith Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: Relatively Important(!) : Buggy gcc Date: Tue, 29 Apr 1997 15:43:37 +0100 Organization: Sony Computer Entertainment Europe Lines: 41 Message-ID: <33660919.23E2@interactive.sony.com> References: <336635d6.3891193@news.playstation.co.uk> <336516C4.2958@micronetics.com> <3366dd38.1265914@news.playstation.co.uk> NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) Alex Amsel wrote: > > On Mon, 28 Apr 1997 22:29:40 +0100, Jim did > quoth at me: > > >padding the structure out. The problem is caused by XNeg, YNeg both > >being a byte each and unaligning the whole structure. > > Funny thing is that it happened when both were UWORDS as well. I got > Mark to double check this, but again it was late at night sooo.... > > We seem to usually get problems with arrays, but then that doesn't > explain bug 1. I'll have to start using gdb I htink, but since I don't > have time for yaroze coding this week it'll have to wait. > > * Alex Amsel * Into Beyond Web Design & JAVA Programming * > * http://www.intobeyond.com * WWFC Utter Rubbish 1996-7* > MM - "Steve Corica is every bit as good as that Kinkladze" Apologies for these peculiar bugs. Cannot offer real insight/explanations, definitely agree that the problem is with padding; I can offer a way to avoid coming up against this: namely, never both with non-integer (ie 32bit long) types in structures. I have never encountered the bug types you report, and I nearly always use ints; if memory is genuinely getting short, use the different bits of ints, eg with accessor macros. Since the trouble seems to arise with arrays of non-simple-int type, avoid them. Sorry if this sounds didactic or frivolous, but I'd far rather quickly work out how to avoid a class of bugs than spend the time tracing it to its (compiler?) basis and then fixing it. Lewis