[Bug fortran/45125] ICE with -fwhole-file

mikael at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Jul 29 10:26:00 GMT 2010



------- Comment #1 from mikael at gcc dot gnu dot org  2010-07-29 10:25 -------
Confirmed. 

Workaround:

trans-decl.c b/trans-decl.c
index d5be2e4..14e78a4 100644
--- a/trans-decl.c
+++ b/trans-decl.c
@@ -1457,7 +1457,10 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
          /* Avoid problems of double deallocation of the backend declaration
             later in gfc_trans_use_stmts; cf. PR 45087.  */
          if (sym->attr.if_source != IFSRC_DECL && sym->attr.use_assoc)
-           sym->attr.use_assoc = 0;
+           {
+             sym->attr.use_assoc = 0;
+             sym->attr.referenced = 1;
+           }

          return sym->backend_decl;
        }


PS: no need to open a PR as long as the patch is not committed ;-)


-- 

mikael at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-29 10:25:54
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45125



More information about the Gcc-bugs mailing list