This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/49112] [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error


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.


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