[gfortran,patch] Fix Fortran/18827
Feng Wang
wf_cs@yahoo.com
Tue Feb 1 09:00:00 GMT 2005
--- 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/
More information about the Fortran
mailing list