Bug 47030 - porting draft patch

Marco Atzeri marco.atzeri@gmail.com
Sat Mar 3 07:20:00 GMT 2018


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

Suggestion will be appreciated
Marco







More information about the Fortran mailing list