From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: tuhs-bounces@minnie.tuhs.org X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIMWL_WL_MED autolearn=ham autolearn_force=no version=3.4.1 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 8b48a288 for ; Fri, 20 Jul 2018 19:58:14 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id 97F79A184D; Sat, 21 Jul 2018 05:58:13 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 658A89E99F; Sat, 21 Jul 2018 05:57:48 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=majumdar-org-uk.20150623.gappssmtp.com header.i=@majumdar-org-uk.20150623.gappssmtp.com header.b=pYcSnSBz; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 6F7AA9E99F; Sat, 21 Jul 2018 05:57:45 +1000 (AEST) Received: from mail-vk0-f68.google.com (mail-vk0-f68.google.com [209.85.213.68]) by minnie.tuhs.org (Postfix) with ESMTPS id 8391F9E3A6 for ; Sat, 21 Jul 2018 05:57:44 +1000 (AEST) Received: by mail-vk0-f68.google.com with SMTP id l143-v6so6622617vke.1 for ; Fri, 20 Jul 2018 12:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=majumdar-org-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EK15frv0F4dIqm/0cKUevEDyyx2CCssJ8kHg7x5J7u0=; b=pYcSnSBzI2jPZfRX9DjGZCZKeFEIBQeYQ1v21vNvLgWKrqHMUluTDlPkfhb+smpCrK AgKO0NQhvZ05kDGU/+CTh9MkkfBO90TozMsUik/ZR1Nqu4y8rC+cO5PcMqpKXt+Bb84F H84/ZvfRHEx5DaH9qbu+khmQ4xOXGkoYlWm8fNTMgzmK6Vl8ta4Jx/UWBJWMwNKl6Lvs mO7g58rlXvoByoBqPvgqKZXZSbdyyWUHeo4sDbO5My8cca5XSqJv7PYscJvom3C3veNx VeghlLu5iOcyErkvUX3PXNk3olGbgLGzo6iJw8o59i72Df5nGtdj5bmPwNlytihsoXTm N9wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EK15frv0F4dIqm/0cKUevEDyyx2CCssJ8kHg7x5J7u0=; b=aDMQaZt6M2FDnpZJlXP5Tb21yCwRiglGI5tPXNZ/R9DxPdRau2BEZjrPy7m3NL1XWP zS7ZJq7VJJ3ROvepKIEt6b6ULp5FHl28qYI/NTCQUJnVvbwxSA7Ctg1UnVqHU7b4LtrW +YU7HHWKhLK9t7ePbrz0ugY+4CHA4P+RJyADg+NgmslOJrhzMvE8dyM/TNpJAHOKhFtD nrR13C11XrFQSm+2KGK3d733xeKO2CeEbt4ZoF2VlkRQz3NPYTpRy6Vayom+kdHGi1tj RLb+c4Nl+Dqhsx106iJFd8gi6JpMNnFgTQHFlD6W3zvy5OMO8zHKVSLD/yD1BEGbv2Lu D6mg== X-Gm-Message-State: AOUpUlFQlvM7YRzLmKHyyY39XL+8n7aE/2elA1xaX89fXCNQ4Cxr/UxP ocGwBH/4CHoIY2kaTE5r4lsrDguUUTylQ4LQKcpNpQ== X-Google-Smtp-Source: AAOMgpdJr7qspg9BI6QB7dsC0pHbi1xSjP2IKXSBs2laQkKDWEkCDTDKfcdxs0Anaj/3ivHrw56VSg+svoyzmsSfSRM= X-Received: by 2002:a1f:1d44:: with SMTP id d65-v6mr2093735vkd.17.1532116663459; Fri, 20 Jul 2018 12:57:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:a5:0:0:0:0:0 with HTTP; Fri, 20 Jul 2018 12:57:43 -0700 (PDT) In-Reply-To: <8ECDA62D-1B54-4391-A226-D3E9ABEE4C07@planet.nl> References: <8ECDA62D-1B54-4391-A226-D3E9ABEE4C07@planet.nl> From: Dibyendu Majumdar Date: Fri, 20 Jul 2018 20:57:43 +0100 Message-ID: To: Paul Ruizendaal Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [TUHS] Looking for final C compiler by Dennis Ritchie X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On 20 July 2018 at 11:04, Paul Ruizendaal 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 w= ith 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 a= rchitecture 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 =E2=80= =98c0=E2=80=99 almost unchanged. The second pass =E2=80=98c1=E2=80=99 would= need major restructuring. It mainly builds a tree for each expression and = then performs various transformations, many of which are PDP11 specific (bu= t also portable ones, like handling of constant expressions). It then cover= s the tree with code fragments selected from a library. This library (=E2= =80=98optable') would need a full rewrite as well. The last pass =E2=80=98c= 2=E2=80=99 is the optimiser and is also highly PDP11 specific. It reads the= assembler output of =E2=80=98c1=E2=80=99 function by function, building an= instruction list. It then performs some portable optimisations (eliminatin= g 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 tha= t some 40% needs rewriting. A new code fragment library would probably be s= ome 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 re= ading that? > I thought that the revival only meant being able to run code in PDP11 emula= tor? Thanks and Regards Dibyendu