* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
@ 2011-12-11 17:43 ` burnus at gcc dot gnu.org
2011-12-11 20:36 ` tkoenig at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-11 17:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.3
Summary|[4.6/4.7 Regression] |[4.6/4.7 Regression]
|Potentially wrong code due |Potentially wrong code
|to wrong implict_pure check |generation due to wrong
| |implict_pure check
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
2011-12-11 17:43 ` [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation " burnus at gcc dot gnu.org
@ 2011-12-11 20:36 ` tkoenig at gcc dot gnu.org
2011-12-11 21:01 ` tkoenig at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-11 20:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-12-11
CC| |tkoenig at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-11 20:29:39 UTC ---
Nitpick: A pure procedure could access the variable, but
it could assign a value to it.
Because
module m
integer :: i
contains
pure subroutine foo(x)
integer, intent(inout) :: x
outer: block
block
i = 5
end block
end block outer
end subroutine foo
end module m
gives the error
Error: Variable 'i' can not appear in a variable definition context
(assignment) at (1) in PURE procedure
the fix should be straightforward.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
2011-12-11 17:43 ` [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation " burnus at gcc dot gnu.org
2011-12-11 20:36 ` tkoenig at gcc dot gnu.org
@ 2011-12-11 21:01 ` tkoenig at gcc dot gnu.org
2011-12-12 8:20 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-11 21:01 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
` (2 preceding siblings ...)
2011-12-11 21:01 ` tkoenig at gcc dot gnu.org
@ 2011-12-12 8:20 ` jakub at gcc dot gnu.org
2011-12-28 22:52 ` tkoenig at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-12-12 8:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
CC| |jakub at gcc dot gnu.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
` (3 preceding siblings ...)
2011-12-12 8:20 ` jakub at gcc dot gnu.org
@ 2011-12-28 22:52 ` tkoenig at gcc dot gnu.org
2011-12-31 8:50 ` tkoenig at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-28 22:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |tkoenig at gcc dot gnu.org
|gnu.org |
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
` (4 preceding siblings ...)
2011-12-28 22:52 ` tkoenig at gcc dot gnu.org
@ 2011-12-31 8:50 ` tkoenig at gcc dot gnu.org
2012-01-01 16:13 ` tkoenig at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-31 8:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502
--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-31 08:19:01 UTC ---
Author: tkoenig
Date: Sat Dec 31 08:18:52 2011
New Revision: 182754
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182754
Log:
2011-12-31 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/51502
* expr.c (gfc_check_vardef_context): When determining
implicit pure status, also check for variable definition
context. Walk up namespaces until a procedure is
found to reset the implict pure attribute.
* resolve.c (gfc_implicit_pure): Walk up namespaces
until a procedure is found.
2011-12-31 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/51502
* lib/gcc-dg.exp (scan-module-absence): New function.
* gfortran.dg/implicit_pure_2.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/implicit_pure_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
` (5 preceding siblings ...)
2011-12-31 8:50 ` tkoenig at gcc dot gnu.org
@ 2012-01-01 16:13 ` tkoenig at gcc dot gnu.org
2012-01-01 16:14 ` tkoenig at gcc dot gnu.org
2012-01-01 16:28 ` tkoenig at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-01-01 16:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502
--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-01-01 16:12:50 UTC ---
Author: tkoenig
Date: Sun Jan 1 16:12:39 2012
New Revision: 182770
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182770
Log:
2012-01-01 Thomas König <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/51502
* expr.c (gfc_check_vardef_context): When determining
implicit pure status, also check for variable definition
context. Walk up namespaces until a procedure is
found to reset the implict pure attribute.
* resolve.c (gfc_implicit_pure): Walk up namespaces
until a procedure is found.
2012-01-01 Thomas König <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/51502
* lib/gcc-dg.exp (scan-module-absence): New function.
* gfortran.dg/implicit_pure_2.f90: New test.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/implicit_pure_2.f90
Modified:
branches/gcc-4_6-branch/gcc/fortran/ChangeLog
branches/gcc-4_6-branch/gcc/fortran/expr.c
branches/gcc-4_6-branch/gcc/fortran/resolve.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/lib/gcc-dg.exp
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
` (6 preceding siblings ...)
2012-01-01 16:13 ` tkoenig at gcc dot gnu.org
@ 2012-01-01 16:14 ` tkoenig at gcc dot gnu.org
2012-01-01 16:28 ` tkoenig at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-01-01 16:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-01-01 16:13:27 UTC ---
Fixed on trunk and 4.6, closing.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check
2011-12-11 17:15 [Bug fortran/51502] New: [4.6/4.7 Regression] Potentially wrong code due to wrong implict_pure check burnus at gcc dot gnu.org
` (7 preceding siblings ...)
2012-01-01 16:14 ` tkoenig at gcc dot gnu.org
@ 2012-01-01 16:28 ` tkoenig at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-01-01 16:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502
--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-01-01 16:27:53 UTC ---
Author: tkoenig
Date: Sun Jan 1 16:27:45 2012
New Revision: 182771
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182771
Log:
2012-01-01 Thomas König <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/51502
* lib/gcc-dg.exp (scan-module-absence): New function.
* gfortran.dg/implicit_pure_2.f90: New test.
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/gcc-dg.exp
^ permalink raw reply [flat|nested] 10+ messages in thread