This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: BLOCK DATA ?
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: Salvatore Filippone <sfilippone at uniroma2 dot it>,fortran at gcc dot gnu dot org, patch <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 30 Aug 2004 14:23:50 +0200
- Subject: Re: BLOCK DATA ?
- References: <1093864861.2750.4.camel@euler> <41331AD7.3000301@physik.uni-muenchen.de>
Forgot two things:
1) CC: gcc-patches
2) ChangeLog
- Tobi
2004-08-30 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* parse.c (accept_statemnt): Make names of BLOCK DATA symbols unique.
Tobias Schlüter wrote:
> Built and tested. I also verified that Salvatore's testcase works now.
>
> - Tobi
>
> Index: parse.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/fortran/parse.c,v
> retrieving revision 1.17
> diff -u -p -r1.17 parse.c
> --- parse.c 17 Aug 2004 15:34:09 -0000 1.17
> +++ parse.c 30 Aug 2004 12:02:13 -0000
> @@ -1062,8 +1062,12 @@ accept_statement (gfc_statement st)
> {
> gfc_symbol *block_data = NULL;
> symbol_attribute attr;
> + static int serial = 0;
> + char name[GFC_MAX_SYMBOL_LEN+1];
>
> - gfc_get_symbol ("_BLOCK_DATA__", gfc_current_ns, &block_data);
> + snprintf (name, GFC_MAX_SYMBOL_LEN, "_BLOCK_DATA_%d", serial++);
> +
> + gfc_get_symbol (name, gfc_current_ns, &block_data);
> gfc_clear_attr (&attr);
> attr.flavor = FL_PROCEDURE;
> attr.proc = PROC_UNKNOWN;
>