This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: Bug 47030 - porting draft patch


On Sat, Mar 03, 2018 at 08:20:45AM +0100, Marco Atzeri wrote:
> On windows platform the "!GCC$ Attributes do not work for COMMON 
> variables in procedures and BLOCK DATA"
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47030
> 
> is blocking me in porting some software to cygwin.
> 
> As finally I am able to build the compiler on my system
> I was trying to adapt the draft.patch to 6.4.0
> but the second portion of this block
> 
> ---------------
> diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
> index ad4ef06..72d9181 100644
> --- a/gcc/fortran/trans-common.c
> +++ b/gcc/fortran/trans-common.c
> @@ -415,6 +415,8 @@ build_common_decl (gfc_common_head *com, tree 
> union_type, bool is_init)
>     /* If there is no backend_decl for the common block, build it.  */
>     if (decl == NULL_TREE)
>       {
> +      tree attributes;
> +
>         decl = build_decl (input_location,
>                           VAR_DECL, get_identifier (com->name), union_type);
>         gfc_set_decl_assembler_name (decl, gfc_sym_mangled_common_id (com));
> @@ -440,6 +442,9 @@ build_common_decl (gfc_common_head *com, tree 
> union_type, bool is_init)
> 
>         gfc_set_decl_location (decl, &com->where);
> 
> +      attributes = gfc_add_attributes_to_decl (common_sym->attr, 
> NULL_TREE);
> +      decl_attributes (&decl, attributes, 0);
> +
>         if (com->threadprivate)
>          DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
> 
> --------------
> 
> have two issues:
> 1) no clue of what common_sym should be
> 2) decl_attributes is not yet defined at that stage
> 

Marco,

Unfortunately, you're treading into a part of the compiler
on a platform that few (if any) current gfortran hackers
work.  IIRC, the person, who opened the PR, is the developer
that did most of the $GCC work.  Tobias has moved on to
other things in life.

-- 
Steve


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