* [patch, fortran] Make block names unique
@ 2011-04-22 20:26 Thomas Koenig
2011-04-25 23:39 ` Thomas Koenig
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Koenig @ 2011-04-22 20:26 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 398 bytes --]
Hello world,
the attached patch makes block names unique, so that
-fdump-fortran-original dumps are easier to read.
Regression-tested. OK for trunk?
Thomas
2011-04-22 Thomas Koenig <tkoenig@gcc.gnu.org>
* decl.c (gfc_match_end): Check that the block name starts
with "block@".
* parse.c (gfc_build_block_ns): Make block names unique by
numbering them.
[-- Attachment #2: p1.diff --]
[-- Type: text/x-patch, Size: 1240 bytes --]
Index: decl.c
===================================================================
--- decl.c (Revision 172856)
+++ decl.c (Arbeitskopie)
@@ -5746,7 +5746,7 @@ gfc_match_end (gfc_statement *st)
{
case COMP_ASSOCIATE:
case COMP_BLOCK:
- if (!strcmp (block_name, "block@"))
+ if (!strncmp (block_name, "block@", strlen("block@")))
block_name = NULL;
break;
Index: parse.c
===================================================================
--- parse.c (Revision 172856)
+++ parse.c (Arbeitskopie)
@@ -3135,6 +3135,7 @@ gfc_namespace*
gfc_build_block_ns (gfc_namespace *parent_ns)
{
gfc_namespace* my_ns;
+ static int numblock = 1;
my_ns = gfc_get_namespace (parent_ns, 1);
my_ns->construct_entities = 1;
@@ -3149,8 +3150,10 @@ gfc_build_block_ns (gfc_namespace *parent_ns)
else
{
gfc_try t;
+ char buffer[20]; /* Enough to hold "block@2147483648\n". */
- gfc_get_symbol ("block@", my_ns, &my_ns->proc_name);
+ snprintf(buffer, sizeof(buffer), "block@%d", numblock++);
+ gfc_get_symbol (buffer, my_ns, &my_ns->proc_name);
t = gfc_add_flavor (&my_ns->proc_name->attr, FL_LABEL,
my_ns->proc_name->name, NULL);
gcc_assert (t == SUCCESS);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch, fortran] Make block names unique
2011-04-22 20:26 [patch, fortran] Make block names unique Thomas Koenig
@ 2011-04-25 23:39 ` Thomas Koenig
2011-04-26 22:08 ` Mikael Morin
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Koenig @ 2011-04-25 23:39 UTC (permalink / raw)
To: fortran, gcc-patches
Am 22.04.2011 22:07, schrieb Thomas Koenig:
> Hello world,
>
> the attached patch makes block names unique, so that
> -fdump-fortran-original dumps are easier to read.
>
> Regression-tested. OK for trunk?
>
> Thomas
>
> 2011-04-22 Thomas Koenig <tkoenig@gcc.gnu.org>
>
> * decl.c (gfc_match_end): Check that the block name starts
> with "block@".
> * parse.c (gfc_build_block_ns): Make block names unique by
> numbering them.
Ping ** 0.25?
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch, fortran] Make block names unique
2011-04-25 23:39 ` Thomas Koenig
@ 2011-04-26 22:08 ` Mikael Morin
2011-04-26 22:31 ` Thomas Koenig
0 siblings, 1 reply; 4+ messages in thread
From: Mikael Morin @ 2011-04-26 22:08 UTC (permalink / raw)
To: fortran; +Cc: Thomas Koenig, gcc-patches
On Tuesday 26 April 2011 00:40:40 Thomas Koenig wrote:
> Am 22.04.2011 22:07, schrieb Thomas Koenig:
> > Hello world,
> >
> > the attached patch makes block names unique, so that
> > -fdump-fortran-original dumps are easier to read.
> >
> > Regression-tested. OK for trunk?
> >
> > Thomas
> >
> > 2011-04-22 Thomas Koenig <tkoenig@gcc.gnu.org>
> >
> > * decl.c (gfc_match_end): Check that the block name starts
> > with "block@".
> > * parse.c (gfc_build_block_ns): Make block names unique by
> > numbering them.
>
> Ping ** 0.25?
>
> Thomas
OK
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch, fortran] Make block names unique
2011-04-26 22:08 ` Mikael Morin
@ 2011-04-26 22:31 ` Thomas Koenig
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Koenig @ 2011-04-26 22:31 UTC (permalink / raw)
To: Mikael Morin; +Cc: fortran, gcc-patches
Hi Mikael,
>>> * decl.c (gfc_match_end): Check that the block name starts
>>> with "block@".
>>> * parse.c (gfc_build_block_ns): Make block names unique by
>>> numbering them.
>>
>> Ping ** 0.25?
>>
>> Thomas
> OK
>
Waiting for Emacs...
Sending fortran/ChangeLog
Sending fortran/decl.c
Sending fortran/parse.c
Transmitting file data ...
Committed revision 172990.
Thanks for the review!
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-26 22:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-22 20:26 [patch, fortran] Make block names unique Thomas Koenig
2011-04-25 23:39 ` Thomas Koenig
2011-04-26 22:08 ` Mikael Morin
2011-04-26 22:31 ` Thomas Koenig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).