This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32881] PURE attribute escapes from contained procedure
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jul 2007 17:22:47 -0000
- Subject: [Bug fortran/32881] PURE attribute escapes from contained procedure
- References: <bug-32881-11659@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2007-07-24 17:22 -------
Confirmed.
The problem is that gfc_pure(NULL) is called and thus
sym = gfc_current_ns->proc_name;
is used as procedure symbol, which is "bar" and not "foo".
The following patch fixes this, but I have not regtested it.
Index: expr.c
===================================================================
--- expr.c (Revision 126873)
+++ expr.c (Arbeitskopie)
@@ -2734,7 +2743,7 @@
return FAILURE;
}
- is_pure = gfc_pure (NULL);
+ is_pure = gfc_pure (lvalue->symtree->n.sym->ns->proc_name);
if (is_pure && gfc_impure_variable (lvalue->symtree->n.sym))
{
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-invalid-code,
| |rejects-valid
Last reconfirmed|0000-00-00 00:00:00 |2007-07-24 17:22:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32881