This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran,patch] Full implementation of assign, assigned goto.
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: Feng Wang <wf_cs at yahoo dot com>, fortran <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 27 Dec 2003 16:30:14 +0100
- Subject: Re: [fortran,patch] Full implementation of assign, assigned goto.
- References: <20031226131115.74788.qmail@web15302.mail.bjs.yahoo.com>
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