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/54880] [OOP] ICE in gfc_create_module_variable, at fortran/trans-decl.c:4013


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

--- Comment #3 from janus at gcc dot gnu.org 2012-10-12 12:52:02 UTC ---
One way to get rid of the error is to simply remove the assert that causes it
(which was already constrained by Paul for PR43450). However, I'm not sure if
that's justified.


Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (revision 192392)
+++ gcc/fortran/trans-decl.c    (working copy)
@@ -4006,15 +4006,6 @@ gfc_create_module_variable (gfc_symbol * sym)
       decl = sym->backend_decl;
       gcc_assert (sym->ns->proc_name->attr.flavor == FL_MODULE);

-      /* -fwhole-file mixes up the contexts so these asserts are unnecessary. 
*/
-      if (!(gfc_option.flag_whole_file && sym->attr.use_assoc))
-    {
-      gcc_assert (TYPE_CONTEXT (decl) == NULL_TREE
-              || TYPE_CONTEXT (decl) == sym->ns->proc_name->backend_decl);
-      gcc_assert (DECL_CONTEXT (TYPE_STUB_DECL (decl)) == NULL_TREE
-              || DECL_CONTEXT (TYPE_STUB_DECL (decl))
-               == sym->ns->proc_name->backend_decl);
-    }
       TYPE_CONTEXT (decl) = sym->ns->proc_name->backend_decl;
       DECL_CONTEXT (TYPE_STUB_DECL (decl)) = sym->ns->proc_name->backend_decl;
       gfc_module_add_decl (cur_module, TYPE_STUB_DECL (decl));


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