Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!hp4nl!ruuinf!piet From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: gnu.gcc.bug Subject: Re: 68000 code generation Message-ID: <1401@ruuinf.cs.ruu.nl> Date: 23 Jun 89 15:37:42 GMT References: <8906221536.AA26520@dvlmarv.UUCP> Sender: piet@ruuinf.cs.ruu.nl Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Distribution: gnu Organization: Dept of Computer Science, University of Utrecht, Holland Lines: 23 In-reply-to: gatech!dvlmarv!richards@EDDIE.MIT.EDU (Richard Sewards) In article <8906221536.AA26520@dvlmarv.UUCP>, gatech!dvlmarv!richards@EDDIE (Richard Sewards) writes: ` ` `I've found a code generation bug in gcc 1.34 with the 68000 code generator. `The following is the assembler output (and corresponding source lines) where `the problem occurs and after that I'm including the entire (preprocessed) `source file which generates the bug with comments at the lines where the `problem is. ` `The problems is that for register pointer variables compared with 0 a `word comparison is done instead of a long comparison. ` ` cmpw #0,a2 This is not a bug, it is a feature. The 68000 instruction actually used is a cmpa (compare address register). If this instruction is used with a word operand that operand is sign-extended, and then compared with the 32-bit address register. So it does the same as the long version, but is 2 bytes shorter. -- Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands Telephone: +31-30-531806. piet@cs.ruu.nl (mcvax!hp4nl!ruuinf!piet)