[Info-vax] yet another sys$qiow question
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Fri Aug 21 16:57:29 EDT 2015
On 2015-08-21 20:32:00 +0000, Bob Gezelter said:
> I do not recall what the C standard says on the subject offhand, but in
> general, one must presume when generating code that variables in a
> global scope are subject to change when invoking an out-of-line
> subroutine (This was the reasoning behind my previous comments that an
> out-of-line invocation ends a basic block).
AFAICT, the salient difference here is that the variables involved in
this case can change after the call has returned; when the variable is
otherwise apparently and fully back in scope. This implies that the
compiler either has to assume that any variable that gets passed by
reference and that goes out of scope might then change at any time
(probably playing havoc with performance, at least for some code), or
it has to figure out which variables can change (involving entirely
non-trivial heuristics, involving the detection of the IOSB, LKSB,
EVSB, etc), or the variables involved have to be marked volatile or
some platform-specific equivalent. Or we have to assume (hope?) that
the compiler doesn't have enough registers and won't try to cache the
IOSB, LKSB, EVSB, etc. Fun times...
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list