[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2021-03-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

--- Comment #9 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:e016c286dae10ea1b037d149fee924bdd07e546a

commit r9-9298-ge016c286dae10ea1b037d149fee924bdd07e546a
Author: Harald Anlauf 
Date:   Tue Oct 27 20:25:23 2020 +0100

PR fortran/97491 - Wrong restriction for VALUE arguments of pure procedures

A dummy argument with the VALUE attribute may be redefined in a PURE or
ELEMENTAL procedure.  Adjust the associated purity check.

gcc/fortran/ChangeLog:

* resolve.c (gfc_impure_variable): A dummy argument with the VALUE
attribute may be redefined without making a procedure impure.

gcc/testsuite/ChangeLog:

* gfortran.dg/value_8.f90: New test.

(cherry picked from commit a764c40079a493826a3678174f908941a383644e)

[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2021-03-16 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

Tobias Burnus  changed:

   What|Removed |Added

 CC||Boyce at engineer dot com

--- Comment #8 from Tobias Burnus  ---
*** Bug 99609 has been marked as a duplicate of this bug. ***

[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2020-11-03 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from anlauf at gcc dot gnu.org ---
Fixed on master for gcc-11 and on 10-branch.  Closing.

Thanks for the report!

[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2020-11-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

--- Comment #6 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:a00894a3a3eb2852cd782a9cc6ee5bd83bfff542

commit r10-8970-ga00894a3a3eb2852cd782a9cc6ee5bd83bfff542
Author: Harald Anlauf 
Date:   Tue Oct 27 20:25:23 2020 +0100

PR fortran/97491 - Wrong restriction for VALUE arguments of pure procedures

A dummy argument with the VALUE attribute may be redefined in a PURE or
ELEMENTAL procedure.  Adjust the associated purity check.

gcc/fortran/ChangeLog:

* resolve.c (gfc_impure_variable): A dummy argument with the VALUE
attribute may be redefined without making a procedure impure.

gcc/testsuite/ChangeLog:

* gfortran.dg/value_8.f90: New test.

(cherry picked from commit a764c40079a493826a3678174f908941a383644e)

[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2020-10-27 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |anlauf at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #5 from anlauf at gcc dot gnu.org ---
Fixed on master so far.

If there is no fallout, and if after some waiting time the patch still seems to
be safe, I'll consider to backport to 10-branch, as Paul mentioned on the ML.

[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2020-10-27 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Harald Anlauf :

https://gcc.gnu.org/g:a764c40079a493826a3678174f908941a383644e

commit r11-4459-ga764c40079a493826a3678174f908941a383644e
Author: Harald Anlauf 
Date:   Tue Oct 27 20:25:23 2020 +0100

PR fortran/97491 - Wrong restriction for VALUE arguments of pure procedures

A dummy argument with the VALUE attribute may be redefined in a PURE or
ELEMENTAL procedure.  Adjust the associated purity check.

gcc/fortran/ChangeLog:

* resolve.c (gfc_impure_variable): A dummy argument with the VALUE
attribute may be redefined without making a procedure impure.

gcc/testsuite/ChangeLog:

* gfortran.dg/value_8.f90: New test.

[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2020-10-26 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

--- Comment #3 from anlauf at gcc dot gnu.org ---
Submitted here: https://gcc.gnu.org/pipermail/fortran/2020-October/055235.html

[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2020-10-24 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

--- Comment #2 from anlauf at gcc dot gnu.org ---
The patch

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index a210f9aad43..096108f4317 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -16476,6 +16507,7 @@ gfc_impure_variable (gfc_symbol *sym)

   proc = sym->ns->proc_name;
   if (sym->attr.dummy
+  && !sym->attr.value
   && ((proc->attr.subroutine && sym->attr.intent == INTENT_IN)
  || proc->attr.function))
 return 1;

regtests fine.  Not sure if this is the best solution, since older
Fortran standards seemed to require INTENT(IN) for dummy x, while
F2018 forbids INTENT(INOUT) and INTENT(OUT), as well as ALLOCATABLE,
POINTER and VOLATILE here.

[Bug fortran/97491] Wrong restriction for VALUE arguments of pure procedures

2020-10-19 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97491

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org
   Last reconfirmed||2020-10-19
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

I've looked at gfc_impure_variable, but do not understand it.