PCC compiler bug and odd solution

FISCHER at RU-BLUE.ARPA FISCHER at RU-BLUE.ARPA
Fri Feb 24 13:14:40 AEST 1984


From:  Ron <FISCHER at RU-BLUE.ARPA>

This 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)
-------



More information about the Comp.unix mailing list