diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-20 09:01:05 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-20 09:01:05 +0000 |
commit | ad046ecfafd816611ab5ecdb1319e052f425c50e (patch) | |
tree | 4875c49c0290393fc8a599cef2d366da0599caab /gcc/fortran/module.c | |
parent | 4aa8e549a47056781bea0481347468e8f9367a3a (diff) | |
download | gcc-ad046ecfafd816611ab5ecdb1319e052f425c50e.tar.gz |
2012-01-20 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 183326 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@183327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 0616a8591f1..b2808d4d9d9 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4351,7 +4351,11 @@ load_needed (pointer_info *p) mio_symbol (sym); sym->attr.use_assoc = 1; - if (only_flag) + + /* Mark as only or rename for later diagnosis for explicitly imported + but not used warnings; don't mark internal symbols such as __vtab, + __def_init etc. */ + if (only_flag && sym->name[0] != '_' && sym->name[1] != '_') sym->attr.use_only = 1; if (p->u.rsym.renamed) sym->attr.use_rename = 1; @@ -4574,8 +4578,9 @@ read_module (void) p = name; /* Exception: Always import vtabs & vtypes. */ - if (p == NULL && (strncmp (name, "__vtab_", 5) == 0 - || strncmp (name, "__vtype_", 6) == 0)) + if (p == NULL && name[0] == '_' + && (strncmp (name, "__vtab_", 5) == 0 + || strncmp (name, "__vtype_", 6) == 0)) p = name; /* Skip symtree nodes not in an ONLY clause, unless there @@ -4641,7 +4646,10 @@ read_module (void) if (strcmp (name, p) != 0) sym->attr.use_rename = 1; - sym->attr.use_only = only_flag; + if (name[0] != '_' + || (strncmp (name, "__vtab_", 5) != 0 + && strncmp (name, "__vtype_", 6) != 0)) + sym->attr.use_only = only_flag; /* Store the symtree pointing to this symbol. */ info->u.rsym.symtree = st; |