The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Dibyendu Majumdar <mobile@majumdar.org.uk>
To: Paul Ruizendaal <pnr@planet.nl>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] Looking for final C compiler by Dennis Ritchie
Date: Fri, 20 Jul 2018 20:57:43 +0100	[thread overview]
Message-ID: <CACXZuxfO1VGCUTSRa_Yj490JRqjw6EupsiK9HnfNjd6r400-hQ@mail.gmail.com> (raw)
In-Reply-To: <8ECDA62D-1B54-4391-A226-D3E9ABEE4C07@planet.nl>

On 20 July 2018 at 11:04, Paul Ruizendaal <pnr@planet.nl> wrote:
>> I will try to port the C compiler to amd64 - while preserving as much of
>> the original code as I can. But not sure if this is even feasible.
>>
> If that is your goal, you might want to start with the version included with 2.11BSD. It is essentially the same as the version from V7, but with 15 more years of bug fixes. I used that source to port V6 Unix to the TI990 architecture back in 2014/2015 and the good thing about it is that it still compiles with a modern gcc.
>

Thank you for the tip - very helpful.


> For your project, I think you would be able to use the first pass ‘c0’ almost unchanged. The second pass ‘c1’ would need major restructuring. It mainly builds a tree for each expression and then performs various transformations, many of which are PDP11 specific (but also portable ones, like handling of constant expressions). It then covers the tree with code fragments selected from a library. This library (‘optable') would need a full rewrite as well. The last pass ‘c2’ is the optimiser and is also highly PDP11 specific. It reads the assembler output of ‘c1’ function by function, building an instruction list. It then performs some portable optimisations (eliminating unnecessary jumps, etc.) and also more PDP11 specific optimisations (the most complex being removing redundant register loads - the concept of which would be reusable).
>
> There are about 12,000 lines of code and as a rough guess I would say that some 40% needs rewriting. A new code fragment library would probably be some 2 to 3 thousand lines.
>

Thank you again for all this info.

> I recall reading about a project to revive the Ritchie C compiler one or two years ago, but a quick web search came up dry. Anybody else remember reading that?
>

I thought that the revival only meant being able to run code in PDP11 emulator?

Thanks and Regards
Dibyendu

  reply	other threads:[~2018-07-20 19:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 10:04 Paul Ruizendaal
2018-07-20 19:57 ` Dibyendu Majumdar [this message]
2018-07-22 20:49 ` Dibyendu Majumdar
2018-07-23  9:24   ` Paul Ruizendaal
2018-07-23 10:28     ` arnold
2018-07-23 19:35       ` Dibyendu Majumdar
2018-07-24  6:37         ` arnold
2018-07-23 15:12   ` Clem Cole
2018-07-23 15:55     ` Larry McVoy
2018-07-23 19:29     ` Dibyendu Majumdar
2018-07-23 20:12     ` Bakul Shah
2018-07-23 20:48       ` Dibyendu Majumdar
  -- strict thread matches above, loose matches on Subject: below --
2018-07-18 21:37 Dibyendu Majumdar
2018-07-19  5:41 ` arnold
2018-07-19 19:23   ` Dibyendu Majumdar
2018-07-20 22:04     ` Dibyendu Majumdar
2018-07-19 14:50 ` Clem Cole
2018-07-19 19:40   ` Dibyendu Majumdar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACXZuxfO1VGCUTSRa_Yj490JRqjw6EupsiK9HnfNjd6r400-hQ@mail.gmail.com \
    --to=mobile@majumdar.org.uk \
    --cc=pnr@planet.nl \
    --cc=tuhs@minnie.tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).