[prev in list] [next in list] [prev in thread] [next in thread] 

List:       9fans
Subject:    Re: [9fans] pcc problem compiling assumed to be correct C file
From:       "rob pike" <rob () plan9 ! bell-labs ! com>
Date:       2001-04-30 19:25:58
Message-ID: 20010430192605.AF6DA19A3A () mail ! cse ! psu ! edu
[Download RAW message or body]

Here is the fix Sean Dorward settled on.

-rob

; yesterday -d dcl.c cc.h
diff /n/dump/2001/0430/sys/src/cmd/cc/dcl.c dcl.c
117c117
< 	snprint(symb, NSYMB, "%s$%d", s->name, (char)s->block);
---
> 	snprint(symb, NSYMB, "%s$%d", s->name, s->block);
diff /n/dump/2001/0430/sys/src/cmd/cc/cc.h cc.h
83,84c83,84
< 	char	block;
< 	char	sueblock;
---
> 	ushort	block;
> 	ushort	sueblock;
98a99
> 	ushort	block;
100d100
< 	char	block;



Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Sat Apr 28 07:08:03 EDT 2001
Received: from mail.cse.psu.edu ([130.203.4.6]) by plan9; Sat Apr 28 07:08:02 EDT 2001
Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.18.6])
	by mail.cse.psu.edu (CSE Mail Server) with ESMTP
	id 589E2199FA; Sat, 28 Apr 2001 07:07:17 -0400 (EDT)
Received: from utrhcs.cs.utwente.nl (utrhcs.cs.utwente.nl [130.89.10.247])
	by mail.cse.psu.edu (CSE Mail Server) with ESMTP id A3DE31998A
	for <9fans@cse.psu.edu>; Sat, 28 Apr 2001 07:06:56 -0400 (EDT)
Received: from zeus.cs.utwente.nl (zeus.cs.utwente.nl [130.89.10.12])
	by utrhcs.cs.utwente.nl (8.9.3/8.9.3) with ESMTP id NAA01059
	for <9fans@cse.psu.edu>; Sat, 28 Apr 2001 13:06:52 +0200 (MET DST)
Received: from copernicus.cs.utwente.nl by zeus.cs.utwente.nl (8.8.8+Sun/csrelay-Sol1.4/RB)
	id NAA18414; Sat, 28 Apr 2001 13:06:53 +0200 (MET DST)
Received: from localhost by copernicus.cs.utwente.nl (8.8.8+Sun/SMI-SVR4)
	id NAA20008; Sat, 28 Apr 2001 13:06:54 +0200 (MET DST)
Message-Id: <200104281106.NAA20008@copernicus.cs.utwente.nl>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] pcc problem compiling assumed to be correct C file
In-reply-to: Your message of "Fri, 27 Apr 2001 16:37:12 +0100."
             <20010427153636.36AA91998A@mail.cse.psu.edu> 
References: <20010427153636.36AA91998A@mail.cse.psu.edu> 
From: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
X-Organisation: University of Twente, Department of Computer Science,
                Formal Methods and Tools Group,
                PO Box 217, NL-7500 AE Enschede, The Netherlands
X-Phone: +31 53 4893774
X-Telefax: +31 53 4893247
X-Face: 3YGZY^_!}k]>-k'9$LK?8GXbi?vs=2v*ut,/8z,z!(QNBk_>~:~"MJ_%i`sLLqGN,DGbkT@
 N\jhX/jNLTz2hO_R"*RF(%bRvk+M,iU7SvVJtC*\B6Ud<7~`MGMp7rCI6LVp=%k=HE?-UCV?[p\$R?
 mI\n2/!#3/wZZsa[m7d;PKWiuH6'~<x[UoHs%Ei=QZA
X-Url: http://www.cs.utwente.nl/~belinfan/
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <20004.988456012.1@copernicus.cs.utwente.nl>
Sender: 9fans-admin@cse.psu.edu
Errors-To: 9fans-admin@cse.psu.edu
X-BeenThere: 9fans@cse.psu.edu
X-Mailman-Version: 2.0.1
Precedence: bulk
Reply-To: 9fans@cse.psu.edu
List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu>
List-Archive: <http://lists.cse.psu.edu/archives/9fans/>
Date: Sat, 28 Apr 2001 13:06:53 +0200

> no, it shouldn't.  it's the first bug i've seen in the port part
> of the compiler for some time.  it's cc/dcl.c:/^mkstatic

I tried two solutions suggested by forsyth in private mail.
 1 changing mkstatic to generate unique symbol names 
 2 changing block to be of ushort instead of char
Unfortunately I tried 1) at work and 2) at home, in slightly different ways.
Having just successfully applied 2) and having to email from linux
and already having rebooted linux I did not want to go back to plan9
to retry 1) in exactely the same way as the succesfull 2).

1) did succeed to compile the code, but the result committed suicide.
   It did _not_ commit suicide when I just run it to print a version
   number, but _did_ suicide when those static variables where
   initialised.
   The suicide could also be explained by the fact that I tried to combine 
   ape-'mode' source with a plan9 yacc-generated y.tab.c and therefore
   had to fiddle with fprint and sprint not being available in ape
   (I did not think in time of -Dalloca=malloc)

2) succeeded and also the result works
   To be sure I also changed sueblock, because I had the impression
   of seeing some assignments from block, I think.
   however, here I used bison-generated y.tab.c and used -Dalloca=malloc
   diff of the change follows.

diff Old/cc.h ./cc.h
83,84c83,84
< 	char	block;
< 	char	sueblock;
---
> 	ushort	block;		// was char
> 	ushort	sueblock;		// was char
100c100
< 	char	block;
---
> 	ushort	block;		// was char
diff Old/dcl.c ./dcl.c
117c117
< 	snprint(symb, NSYMB, "%s$%d", s->name, (char)s->block);
---
> 	snprint(symb, NSYMB, "%s$%d", s->name, (ushort)s->block);	// was (char)


Regards,
Axel (who still very much wants his plan9 ppp to (finally?) work :-/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic