This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49112] [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 May 2011 19:28:53 +0000
- Subject: [Bug fortran/49112] [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error
- Auto-submitted: auto-generated
- References: <bug-49112-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49112
--- Comment #9 from janus at gcc dot gnu.org 2011-05-30 19:28:52 UTC ---
(In reply to comment #3)
> Here is a reduced test case for the duplicate SAVE attribute:
The duplicate SAVE warning of comment #3 can be fixed with something like this:
Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c (revision 174416)
+++ gcc/fortran/symbol.c (working copy)
@@ -3400,7 +3400,8 @@ save_symbol (gfc_symbol *sym)
if (sym->attr.in_common
|| sym->attr.dummy
|| sym->attr.result
- || sym->attr.flavor != FL_VARIABLE)
+ || sym->attr.flavor != FL_VARIABLE
+ || (sym->name[0]=='_' && sym->name[1]=='_'))
return;
/* Automatic objects are not saved. */
if (gfc_is_var_automatic (sym))
This prevents 'internal' symbols, starting with '__', from getting a SAVE
attribute twice.