This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran,patch] Fix Fortran/18827


 --- Paul Brook <paul@codesourcery.com> 的正文:
> On Wednesday 12 January 2005 05:26, Feng Wang wrote:
> 
> Are you sure you are testing the right thing? Do you have checking enabled?
> I still see several testsuite failures.
> > > > > gfc_conv_label_variable (gfc_se * se, gfc_expr * expr)
> > > > > {
> > > > >   gcc_assert (expr->symtree->n.sym->attr.assign != 1);

This is should be "== 1". Indeed I added "--disable-checking" to configuration
options when bootstrapped. Thanks, Paul.

> 
> A few comments of the patch itself:
> 
> > *************** build_field (segment_info *h, tree union
> > *** 242,247 ****
> > --- 242,270 ----
> >                               size_binop (PLUS_EXPR,
> >                                           DECL_FIELD_OFFSET (field),
> >                                           DECL_SIZE_UNIT (field)));
> > +   /* If this field is assigned to a lable, we create another two
> variables
> > +      to hold the address of taget label or the format string of format
> > +      label.  */
> > +   if (h->sym->attr.assign)
> > +     {
> > +       tree len;
> > +       tree addr;
> > +
> > +       gfc_allocate_lang_decl (field);
> > +       GFC_DECL_ASSIGN (field) = 1;
> 
> Do we ever use this flag anywhere?
>
 
No now. It indicates that the variable or common field is assigned a label and
we can use GFC_DECL_ASSIGN_ADDR & GFC_DECL_STRING_LEN to get the auxiliary
variables. It is useful to check the validate on the tree level.

> > +       len = gfc_create_var_np (gfc_charlen_type_node,h->sym->name);
> > +       addr = gfc_create_var_np (pvoid_type_node, h->sym->name);
> > +       TREE_STATIC (len) = 1;
> > +       TREE_STATIC (addr) = 1;
> > +       DECL_INITIAL (len) = build_int_cst (NULL_TREE, -2);
> > +       TREE_PUBLIC (len) = 1;
> > +       TREE_PUBLIC (addr) = 1;
> 
> Why do you make these public symbols?
> 
Originally, I wanted to create just one set of variables for one common field
which is assigned a lable, even in different modules. Just like common fields'
creation. But this is not correct. The lables is local. These public flags
should be deleted.

> > + /* Converts a varible assigned a label.  */
> > + void
> > + gfc_conv_label_variable (gfc_se * se, gfc_expr * expr)
> 
> This isn't a fairly useless comment. It took me a while to figure out what 
> this routine does, so I think it could do with documenting better. Maybe 
> something like:
> /* Given a variable expression which has been ASSIGNed to, find the decl 
> containing the axiliary variables.  For variables in common blocks this may 
> be a field_decl.  */
> 
OK. Changed.
I will give a new patch.

Best Regards,
Feng Wang

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]