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: [fortran,patch] Full implementation of assign, assigned goto.


On Friday 26 December 2003 14:11, Feng Wang wrote:
> Hi, all
>   This patch implemented assign, assigned goto and related i/o statements,
> including assigned goto with a label list.
>   Steven, can you help me check them again? If it is Ok, please apply them.
> Thanks.

Sure.


> *************** gfc_show_code_node (int level, gfc_code
> *** 797,803 ****
>         break;
>
>       case EXEC_GOTO:
> !       gfc_status ("GOTO %d", c->label->value);
>         break;
>
>       case EXEC_CALL:
> --- 802,812 ----
>         break;
>
>       case EXEC_GOTO:
> !       gfc_status ("GOTO ");
> !       if (c->label)
> !         gfc_status ("%d", c->label->value);
> !       else
> !         gfc_show_expr (c->expr);
>         break;

You are not dumping a label list here for assigned goto.


> *************** gfc_get_symbol_decl (gfc_symbol * sym)
> *** 716,721 ****
> --- 715,732 ----
>
>     gfc_finish_var_decl (decl, sym);
>
> +   if (sym->attr.assign)
> +     {
> +       gfc_allocate_lang_decl (decl);
> +       GFC_DECL_ASSIGN (decl) = 1;
> +       GFC_DECL_STRING_LENGTH (decl) =
> +         gfc_create_var (gfc_strlen_type_node, sym->name);
> +       GFC_DECL_ASSIGN_ADDR (decl) = gfc_create_var (pvoid_type_node, 
sym->name);
> +       TREE_STATIC (GFC_DECL_STRING_LENGTH (decl)) = 1;
> +       DECL_INITIAL (GFC_DECL_STRING_LENGTH (decl)) =
> +         build_int_2 (-2, -1);
> +     }
> +
>     /* TODO: Initialization of pointer variables.  */
>     switch (sym->ts.type)
>       {

I'm not quite sure I understand what you are doing here.  What is the
"-2" required for, you don't seem to use it anywhere.  Please explain,
this could use some comment for the ignorant reader ;-)


> --- 379,415 ----
>   {
>     gfc_se se;
>     tree tmp;
> +   tree error;
> +   tree io;
> +   tree len;
>
>     gfc_init_se (&se, NULL);
>     gfc_conv_expr (&se, e);

I wouldn't call a variable "error" because it's defined as a function
in gcc:diagnostic.c, which we should probably start using at some
point (or not...?).  Just call it "error_msg" or just "msg" or whatever.


Other than that, looks OK to me.

Gr.
Steven



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