[patch,gfortran] Fix PR17917 - module equivalences

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch,gfortran] Fix PR17917 - module equivalences

Paul Thomas-10
(Properly tabbed version is attached.)

2005-06-17 Paul Thomas
PR fortran/17917
Port from g95.
* module.c (load_equiv): New function.
(read_module): Call load_equiv.
(write_equiv): New function. Correct string referencing for
gfc functions.
(write_module): Call write_equiv.
* trans_decl.c (gfc_create_module_variable): Return for
equivalenced symbols with existing backend declaration.
* gfortran.h (gfc_equiv): Add field for module name.

2005-06-17 Paul Thomas
PR fortran/17917
* gfortran.dg/module_equiv.f90: New.

This has been regtested on the 20050515 snapshot/Cygwin_NT. I will bootstrap and regtest
with cvs at the beginning of next week, when I return from this trip. OK for mainline and
4.0x?

If somebody else is willing and able to do the committing before I can, please be my guest.

Paul T

equiv.txt (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch,gfortran] Fix PR17917 - module equivalences

Steven Bosscher
On Thursday 16 June 2005 18:20, Paul THOMAS wrote:

> (Properly tabbed version is attached.)
>
> 2005-06-17 Paul Thomas
> PR fortran/17917
> Port from g95.
> * module.c (load_equiv): New function.
> (read_module): Call load_equiv.
> (write_equiv): New function. Correct string referencing for
> gfc functions.
> (write_module): Call write_equiv.
> * trans_decl.c (gfc_create_module_variable): Return for
> equivalenced symbols with existing backend declaration.
> * gfortran.h (gfc_equiv): Add field for module name.
>
> 2005-06-17 Paul Thomas
> PR fortran/17917
> * gfortran.dg/module_equiv.f90: New.


+   /* Equivalenced variables arrive here after creation.  */
+   if (sym->backend_decl && sym->equiv_built)
+       return;
+

Odd indentation.


+   const char *module;

Could you explain what this is for?  I see we write it and read it,
but it's not used for anything else.  Needed for follow-up work?

Otherwise this looks good.

Gr.
Steven

Reply | Threaded
Open this post in threaded view
|

Re: [patch,gfortran] Fix PR17917 - module equivalences

Paul Thomas-10
In reply to this post by Paul Thomas-10
Steven,

> + /* Equivalenced variables arrive here after creation. */
> + if (sym->backend_decl && sym->equiv_built)
> + return;
> +
>
> Odd indentation.
>

Thanks.
 
>
> + const char *module;
>
> Could you explain what this is for? I see we write it and read it,
> but it's not used for anything else. Needed for follow-up work?
>
 
I saw that too; I presumed that I was missing something and left it alone.  I'll check out all the uses of gfc_equiv->module in the other product.

Paul T

Reply | Threaded
Open this post in threaded view
|

Re: [patch,gfortran] Fix PR17917 - module equivalences

Paul Thomas-10
In reply to this post by Paul Thomas-10
> Could you explain what this is for? I see we write it and read it,
> but it's not used for anything else. Needed for follow-up work?
>

The module name is used to prevent multiple declarations of each union in the host scope.
As it stands, the code runs correctly but looks messy.  I'll implement what is
needed in trans-common.c(build_module_equivalences).

Paul T

Reply | Threaded
Open this post in threaded view
|

Re: [patch,gfortran] Fix PR17917 - module equivalences

Paul Thomas-10
In reply to this post by Paul Thomas-10
Steven,

> + const char *module;
>
> Could you explain what this is for? I see we write it and read it,
> but it's not used for anything else. Needed for follow-up work?
>
I have implemented the use of module but it does not eliminate the duplication of the declaration of module equivalence unions.  There is something wierd happening upstream.  I will investigate tonight.  I hope to tie up the package over the weekend.

Paul