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/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check


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

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-11 20:56:54 UTC ---
The problem occurs in expr.c:


  if (!pointer && gfc_implicit_pure (NULL) && gfc_impure_variable (sym))
    gfc_current_ns->proc_name->attr.implicit_pure = 0;

assumes that gfc_current_ns points to the current procedure, which
is wrong in the case of blocks.

Maybe it would make sense to have a global gfc_proc_name?

Also, the logic in gfc_implicit_pure() appears to be wrong
because it does not look for parent namespaces.


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