Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!bloom-beacon!mit-eddie!uw-beaver!uw-june!uw-entropy!dataio!pilchuck!nwnexus!happym!kent From: kent@happym.wa.com (Kent Forschmiedt) Newsgroups: comp.bugs.misc Subject: Re: Need help with C bug. Keywords: pcc2 char array code generation Message-ID: <765@happym.wa.com> Date: 3 Apr 89 08:16:40 GMT References: <349@iconsys.UUCP> <24971@pbhya.PacBell.COM> <1362@auspex.auspex.com> Reply-To: kent@happym.UUCP (0000-Kent Forschmiedt) Distribution: usa Organization: Happy Man Corp., Seattle Lines: 54 Somebody complained that his Motorola Unix compiler miscompiles the following: >> char p[50]; >> main() >> { >> printf("p = 0x%08X\n", p); >> if (p) >> printf("ok\n"); >> else >> printf("bad berries\n"); Yes, indeed, it is a compiler bug. Motorola's c compiler is broken in many, many places. Don't hold your breath waiting for fixes unless you are particularly fond of cyanosis. I have been trying for over two years to get a working compiler out of Motorola. I have submitted many bug reports to Motorola, with many bugs shown in excruciating detail. I have annotated hundreds of lines of assembly code. My compiler will not produce working 68881 code. It will not properly compile the statement: p && free(p); I reported an assembler bug. I included the original C code, the compiler output, and a typescript of a debugger session in which I demonstrated the circumstances under which as would generate an incorrect branch displacement. An "engineer" eventually informed me that there was no bug, that the assembler was functioning correctly. I was comforted only momentarily, however, since the machine persisted in reporting an illegal instruction immediately after the branch was executed. I spent around 150 hours trying to produce a working gcc binary with the Motorola compiler. Unfortunately, it miscompiles the output of genrecog.c. I finally gave up in disgust. I submitted bug reports during the original warranty period, and refused to purchase a service contract until a working compiler was delivered. I have spent many, many hours talking to many, many Motorola employees. Said employees are uniformly polite, eager to help, and produce very little that is of any use to me. They do not follow up on their promises. They do not test their products (I was delivered a compiler and a long list of "bug fixes." It would not compile all of the test programs included with the original bug reports which it claimed to answer). I eventually did purchase a service contract to avoid an exorbitant repair bill for a failed disk controller. They refused to sell the hardware contract without the software contract. Of course, as might be expected, they have displayed absolutely no inclination to honor the software contract. -- kent@happym.wa.com, tikal!camco!happym!kent, Happy Man Corp 206-282-9598