mmuegel@fwhnm02.fwrdc.rtsg.mot.com (Michael S. Muegel) (05/15/91)
Just wanted to warn everyone of some major cc6.8 bugs we have been running into recently. Many have to do with optimization (imagine that ;-). Some, however, rear their ugly heads with some very simple code. All occur only on the 680x0 architecture. Here is one example: #include <stdio.h> main() { long value; value = 0x10000L; #ifdef PRINT_INITIAL printf(" Initial value = %lX\n", value); #endif value &= 0xffffL; printf(" Final value = %lX\n", value); } And some results: % cc -DPRINT_INITIAL -DRA -g -W0,-opt,4 -o test2 test2.c ;test2 Initial value = 10000 Final value = 0 % cc -DRA -g -W0,-opt,4 -o test2 test2.c ;test2 Final value = FF00 In the above example, the OPT level is 4, and the result is correct if the printf() is compiled, but incorrect if the printf() is not compiled. We have some more complex examples that show cc errors when optimization is turned OFF! After calling this in to HP/Apollo (and it was verified by them as a bug) I received a new rev of cc6.8. Here are the relevant time stamps from the executables in /usr/apollo/lib: Ver Name Time Stamp File Name -------------------------------------------------------------- c 1 cc 1990/12/06 19:33:07 CDT (Thu) cc.m68k.old c 1 cc 1991/04/24 12:57:23 CDT (Wed) cc.m68k The newest cc.m68k is version 6.82(191). -Mike -- +-----------------------------------------------------------------------------+ | Mike Muegel | Internet: mmuegel@mot.com | | Software Tools Group | UUCP: uunet!motcid!muegel | | Fort Worth Research & Development Center | Voice: (817) 232-6129 | | Radio Telephone and Systems Group | ... My opinions are surely not | | Motorola, Inc. | shared by Motorola :-& | +-----------------------------------------------------------------------------+