Subject: Re: R&W function

From: Zheng Gengbing <[email-masked]>
Date: Thu, 11 Apr 1996 12:10:26 +0800 (EAT)

On Wed, 10 Apr 1996, Guansong Zhang wrote:

> >     We changed the readnodes.c , writenodes.c for these reasons:
> >
> > 	1. since we add two new field to llnd :
> > 	   attr ,     // record the attributes of a llnd , used in expr
> > 	   const_val  // record the integer constant value .
> > 	   this must be reflected in  .dep .
> > 	2. record declared_name of a VARIABLE_NAME to .dep .
> > 	3. record T_KIND , a new llnd .
> > 	4. record the scope of a label .
> >
> > 	I noticed that someone changed some part of writenodes.c in line 402
> >   about FIELD_NAME , but forgot to add the n from 3 to 5 !
> 
> What does this mean? Do we have corrected version in 1.25?

	That is what I found in 1.25 , so I will modified this in next version.
But I don't know why it was added 2 items in FIELD_NAME ?

> 
> >
> > 	I am sure it is safe for HIT to use these functions ,provided the
> > readnode & writenode are strictly matched in basicop . Since what HIT need is
> > writenodes , this only dump the .dep when nearly finish the first parse, so
> > use a different writenodes  cannot effect their work .
> >
> 
> While the following is the result when I put r&w in 1.25 to 1.20.
> 
> I compare the results with the thing I think previously is good. They are
> infact not much difference. You will notice two things:
> 
> 1. Only testV and testZ's unparse results are problem, see the lnk file, your
> will find that somehow the PROC_HEDR's def is changed. This happened when I
> merge global header file, I think I can change unparse to make it correct
> later.

	In our machine , there is no problem you mentioned about testV & Z.
No change was done to PROC_HEDR .

	I don't know how you changed the def of PROC_HEDR , I hope it will
not effect our work of hpfcc. If it do , please give me a new defintion.

> 
> 2. All other change are same kind of thing, they don't affect unparse, but they
> do reflects different kind of def in one node. I don't know why read&write will
> change that?
> 

	It is natrual to expand the information stored in .dep after we add new
difintion in node .
	give this example about VARIABLE_NAME:
9-S  503    2-T 131072   ----    2-B            zx1 local= 600 nxt_in=  
---- nxt_out=  ----     VARIABLE_NAME

	The only thing diffrent from old one is the attr field from 0 to 
131072 .131072 is the attributes of DITRIBUTE_BIT . That's the result of our 
modification in fD.y , where we add the attribute to symbol nodes .

	other example about PROGRAM_NAME :
2-S  505   ----    0   ----    1-B   directive_11 symb_lst=         ---- prog
_hedr=    2-B      PROGRAM_NAME

	As to PROGRAM_NAME , I don't know who add 2-B to prog_hedr . We did
not change that .

PS .

	I 'v tested the dumpdep & unparse in testsuite , everything seemed 
ok.  
	The result of  make compare testsuite/unparse is :
		except z7.f  , all is allright
	the result of testsuite/dumpdep :
		except PROGRAM_NAME & VARIABLE_NAME , all are the same .

***************************************************************************
*     Zheng Gengbin                 *                                     *
*                                   *                                     *
*  Dept. of Computer Science        *  Phone:  86-10-2585088              *
*         & Technology              *  Email:                             *
*                                   *      [email-masked]   *
*  Peking University P.R.China      *  Mail:                              *
*                                   *      Room 1077 ,Building 47,        *
*                                   *      Peking University, P.R.China   *
***************************************************************************

---

From: Zheng Gengbing <[email-masked]>
Date: Thu, 11 Apr 1996 19:08:04 +0800 (EAT)

> What does this mean? Do we have corrected version in 1.25?

	Sorry , I made a mistake , the FIELD_NAME is commented , and the
number is really 3 .

Zheng Gengbin