Re: New GCC compiler for 8086 cpu's

Alan Cox <[email protected]> Tue, 20 Jun 2017 12:37:44 +0100
Newsgroups org.kernel.vger.linux-8086
Message-ID <20170620123711.2f7d79d3@alans-desktop>
> Of course, this is the kind of problems I expect to happen. To prevent
> this case, one rule of the simple set of rules would be "Use automatic
> variables only within the function where it is defined".

That still doesn't work. The compiler will generate address references to
stack objects itself as will normal things like pointers into an array.

Faced with s = s + 1 for an auto variable the compiler is likely to
generate something like a word increment of &s, but it's not going to
magically put segments in.

The DOS folks spent a long time writing very good compilers - they never
figured out a hack for this; although in many other languages SS != DS
isn't a problem.

Alan