Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!floyd!harpo!seismo!hao!hplabs!sri-unix!FISCHER@RU-BLUE.ARPA From: FISCHER@RU-BLUE.ARPA Newsgroups: net.unix Subject: PCC compiler bug and odd solution Message-ID: <16888@sri-arpa.UUCP> Date: Thu, 23-Feb-84 22:14:40 EST Article-I.D.: sri-arpa.16888 Posted: Thu Feb 23 22:14:40 1984 Date-Received: Fri, 2-Mar-84 11:21:48 EST Lines: 31 From: RonThis refers to UniPlus UNIX from version III (by UNISOFT). After much hunting around I found an odd problem. The compiler was generating bogus code at the end of a function. The function accepted a pointer to a structure and returned nothing. The bogus code included a small area in common storage (.bss), large enough to hold one copy of the structure that was passed into the function, and some instructions to copy from a structure pointed to by an uninitialized working register, into the .bss area. The bogus code then put the address of the .bss area in the return value register. There was also normal "return from a function" code in there. By examining the assembler output files in detail I determined that this only happens for the FIRST function in the file that accepts a pointer to a structure (may happen again for different types of structure, I don't know). The fixI used (not being able to get source, Mr. Gwyn) was to just put a bogus procedure at the top of the file that accepts a pointer to a structure as its argument. Thought I'd send the symptoms in. Was confusing because the superficial error resulting is a "bus error," and adb shows it occurring in an odd piece of code... Is this a standard problem of PCC, perhaps an old problem? (ron) -------