home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!ray
- From: ray@netcom.com (Ray Fischer)
- Subject: Anyone else seen this MPW C bug?
- Message-ID: <1992Dec17.024634.5959@netcom.com>
- Organization: Netcom. San Jose, California
- Distribution: na
- Date: Thu, 17 Dec 1992 02:46:34 GMT
- Lines: 27
-
- I just came across an incredibly blatant MPW C bug, and I'm having a
- hard time believing that it hasn't been fixed yet. Briefly, if you
- multiply a long integer by constant 12 with the mc68020 option on, the
- MPW compiler generates the wrong code!
-
- This is with MPW C 3.2; if there is a newer version that fixes the problem
- that I haven't heard about, I'd really appreciate someone letting me
- know about it.
-
- If you want to try it yourself, here's a sample program.
- Use the mc68020 option.
-
- main() {
- long a,b;
- a = 3000;
- b = a * 12;
- return b;
- }
-
- The compiler generates an LEA to multiply by 3 (which is good) but
- then uses an ASL.W to multiply by 4 (instead of ASL.L)!
-
- Help?
-
- --
- Ray Fischer "Convictions are more dangerous enemies of truth
- ray@netcom.com than lies." -- Friedrich Nietszsche
-