Related articles |
---|
GNU gcc/g++ with 386 segmented architecture. mgcd@QSof01.alcbel.be (1996-06-24) |
Re: GNU gcc/g++ with 386 segmented architecture. kanze@lts.sel.alcatel.de (1996-06-24) |
Re: GNU gcc/g++ with 386 segmented architecture. dennis@netcom.com (1996-06-26) |
Re: GNU gcc/g++ with 386 segmented architecture. khays@sequent.com (1996-06-26) |
Re: GNU gcc/g++ with 386 segmented architecture. bill.williams@gecm.com (1996-06-27) |
Re: GNU gcc/g++ with 386 segmented architecture. dlmoore@ix.netcom.com (1996-06-30) |
Re: GNU gcc/g++ with 386 segmented architecture. paik@3dfx.com (1996-07-01) |
Re: GNU gcc/g++ with 386 segmented architecture. dlmoore@ix.netcom.com (1996-07-01) |
Re: GNU gcc/g++ with 386 segmented architecture. brian@watcom.on.ca (1996-07-01) |
Re: GNU gcc/g++ with 386 segmented architecture. sef@kithrup.com (Sean Eric Fagan) (1996-07-01) |
From: | khays@sequent.com (Kirk Hays) |
Newsgroups: | comp.compilers |
Date: | 26 Jun 1996 11:44:35 -0400 |
Organization: | Sequent Computer Systems, Inc. |
References: | 96-06-100 |
Keywords: | GCC, 386, comment |
Martin G C Davies <mgcd@QSof01.alcbel.be> wrote:
>
>I would like gcc and g++ on an Intel 386 but with a segmented architecture
>i.e. pointers are 48 bits (a segment (DS/ES/FS/GS) and a base/index/offset).
>
>I have had a look at the document "Using and Porting GNU CC" and there seems
>to be no mode that I can use for such a pointer e.g. SImode, PDImode,
>BLKmode etc.
>
>Is it possible to do this and, even better, has anyone done it?
It can't be done with GCC, as GCC confuses pointers with integers early in
the conversion to RTL.
You'd have to rewrite large portions of the RTL handling, adding new "large
pointer" types, etc. A Major Project.
I know - I've sized it.
I've looked at doing this with lcc, and think it might be more tractable,
but I haven't actually sized the effort.
>Any help or suggestions would be very useful (even if the answer is "it
>can't be done").
It can be done, and should be done, as lots of sloppy C code can be caught
by large model.
Personally, I'd love to have a "check-out" compiler (interpreter, more
likely) that allowed one to trap uninitialized data accesses, random
pointers, boundary condition math, etc. Particularly nice would be the
ability to set the sizes of integer types, and to "tune" to generate "code"
that mimics a particular architecture.
>[GCC believes very strongly that its target machine has a flat address space.
>It may be doable, but it'd be a huge project. I've never seen a C compiler
>that did 386 large model. Are there any? -John]
A few.
Microsoft C did it for a while.
Intel's C-386 did it, Watcom's C compiler used to (and may still),
Metaware's High-C could be forced into it, using pragmas, but they were no
longer providing the standard libraries for large mode in 1994.
As we move away from the obvious usage of the x86 segmented architecture,
more compilers are dropping support for the different models of
segmentation, and going to "flat mode".
--
Kirk Hays
[I believe that Centerline's Codecenter and Objectcenter products (formerly
Saber C and C++) are essentially the checkout compilers you're asking for.
-John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.