Asri-unix.397
net.unix-wizards
utzoo!decvax!ucbvax!menlo70!sri-unix!gwyn@UTEXAS-11
Fri Jan 1 20:10:45 1982
PDP-11 C compiler bug
The following problem exists at least for a 7th Ed. C system on a 6th Ed.
kernel: When a large (greater than 8Kb) floating-point array is allocated
local to a block, that is, off the stack, and a reference is made to a f.p.
variable allocated after the array, an unrecoverable segmentation violation
occurs. I believe this is due to a "hole" in the allocated segmentation
registers and a problem in the kernel when trying to grow the stack by more
than 8Kb at once when the faulting instruction is floating-point.
I fixed this by modifying the generated code slightly: After entry to the
procedure in question, there is code to extend the stack by updating the
stack pointer to point to top of local variable pool. Just after this, I
generated "tst (sp)" if and only if (a) floating-point is used in the
procedure, and (b) the stack wasn't grown by "tst -(sp)" instructions, which
keep have already gotten the mapping registers set up to cover the stack.
-------
-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <
[email protected]>
of
http://communication.ucsd.edu/A-News/
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
1. There is no money collected for the text(s) of the articles.
2. The following notice remains appended to each copy:
The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.