Article View: comp.sys.atari.st
Article #33428Bug in MWC 3.0
From: Dan Wilga
Date: Sun, 31 Jul 1988 23:32
Date: Sun, 31 Jul 1988 23:32
41 lines
1598 bytes
1598 bytes
Greetings,
It would appear that I have truly found a real honest-to-goodness bug in
MWC 3.0.6. The following is a code segment that was compiled with the
-VPEEP option.
int in_wind[7], max_itm[7], w_num, rez;
...
slider()
{
int b;
...
if( (b = b * in_wind[w_num] / (max_itm[w_num]+in_wind[w_num]))
< (4<<rez) ) b = 4<<rez;
...
}
A disassembly of the first part of this statement:
slider_+0x282 moveq.l $0x4, d2 / correctly moves 4 into d2
slider_+0x284 move.w rez_, d2 / then overwrites d2 with rez
slider_+0x28A lsl.w d2, d2 / result is rez<<rez, not 4<<rez
If the condition proves to be true, then "b" is assigned correctly; the
code generated uses d0 and d2 to do the shift.
This may or may not be related to the -VPEEP option, though this is the
first time I have had any trouble with it. I just thought you all might like
to be aware of this problem.
----------------------------------------------------------------------------
Dan Wilga "My Other Program
Gribnif Software is Also a Porsche"
(413) 584-7887
Gribnif@UMASS.Bitnet
Gribnif%UMASS.Bitnet@Forsythe.Stanford.EDU
Technical Details
Message-ID:
<880731193042228.ACQF@Mars.UCC.UMass.EDU>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!peregrine!elroy!ames!pasteur!ucbvax!UMass.BITNET!GribnifShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!peregrine!elroy!ames!pasteur!ucbvax!UMass.BITNET!Gribnif From: Gribnif@UMass.BITNET (Dan Wilga) Newsgroups: comp.sys.atari.st Subject: Bug in MWC 3.0 Message-ID: <880731193042228.ACQF@Mars.UCC.UMass.EDU> Date: 31 Jul 88 23:32:12 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 41