public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected
@ 2020-11-05  7:20 mscfd at gmx dot net
  2020-12-10 15:57 ` [Bug fortran/97723] " pault at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: mscfd at gmx dot net @ 2020-11-05  7:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

            Bug ID: 97723
           Summary: type bound ASSIGNMENT(=) within select rank block
                    wrongly rejected
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mscfd at gmx dot net
  Target Milestone: ---

Created attachment 49504
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49504&action=edit
Fortran source code

Using an assignment for a derived-type within a select-rank block is rejected
wrongly:

rank_assign.f90:41:16:

   41 |          s = '0'
      |                1
Error: ‘assign’ at (1) is not a function
rank_assign.f90:43:16:

   43 |          s = '1'
      |                1
Error: ‘assign’ at (1) is not a function
rank_assign.f90:45:16:

   45 |          s = '?'
      |                1
Error: ‘assign’ at (1) is not a function

Using the assignment outside of such a select-rank works fine. Writing "s%c =
..." instead of "s = ..." also works well.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/97723] type bound ASSIGNMENT(=) within select rank block wrongly rejected
  2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
@ 2020-12-10 15:57 ` pault at gcc dot gnu.org
  2020-12-10 15:58 ` pault at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2020-12-10 15:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu.org

--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 49730
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49730&action=edit
Fix for the PR

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/97723] type bound ASSIGNMENT(=) within select rank block wrongly rejected
  2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
  2020-12-10 15:57 ` [Bug fortran/97723] " pault at gcc dot gnu.org
@ 2020-12-10 15:58 ` pault at gcc dot gnu.org
  2020-12-10 16:28 ` pault at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2020-12-10 15:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-12-10
           Assignee|unassigned at gcc dot gnu.org      |pault at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> ---
Blast! Finger slipped....

The fix regtests OK. I will commit as 'obvious' with a test case in the next
day or two.

Thanks for the report.

Paul

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/97723] type bound ASSIGNMENT(=) within select rank block wrongly rejected
  2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
  2020-12-10 15:57 ` [Bug fortran/97723] " pault at gcc dot gnu.org
  2020-12-10 15:58 ` pault at gcc dot gnu.org
@ 2020-12-10 16:28 ` pault at gcc dot gnu.org
  2020-12-11 13:53 ` pault at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2020-12-10 16:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #2)
> 
> The fix regtests OK. I will commit as 'obvious' with a test case in the next
> day or two.

Cancel that, there is one regression.

Paul

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/97723] type bound ASSIGNMENT(=) within select rank block wrongly rejected
  2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
                   ` (2 preceding siblings ...)
  2020-12-10 16:28 ` pault at gcc dot gnu.org
@ 2020-12-11 13:53 ` pault at gcc dot gnu.org
  2020-12-11 18:01 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2020-12-11 13:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
Please see PR97694 for a patch that fixes both PRs at once.

Paul

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/97723] type bound ASSIGNMENT(=) within select rank block wrongly rejected
  2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
                   ` (3 preceding siblings ...)
  2020-12-11 13:53 ` pault at gcc dot gnu.org
@ 2020-12-11 18:01 ` dominiq at lps dot ens.fr
  2020-12-27 14:59 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-12-11 18:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/97723] type bound ASSIGNMENT(=) within select rank block wrongly rejected
  2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
                   ` (4 preceding siblings ...)
  2020-12-11 18:01 ` dominiq at lps dot ens.fr
@ 2020-12-27 14:59 ` cvs-commit at gcc dot gnu.org
  2021-09-10 20:16 ` cvs-commit at gcc dot gnu.org
  2021-09-10 20:23 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-27 14:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

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

commit r11-6346-gc4a678981572c12d158709ace0d3f23dd04cf217
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Sun Dec 27 14:59:38 2020 +0000

    Fortran: Fix some select rank issues [PR97694 and 97723].

    2020-12-27  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/97694
            PR fortran/97723
            * check.c (allocatable_check): Select rank temporaries are
            permitted even though they are treated as associate variables.
            * resolve.c (gfc_resolve_code): Break on select rank as well as
            select type so that the block os resolved.
            * trans-stmt.c (trans_associate_var): Class associate variables
            that are optional dummies must use the backend_decl.

    gcc/testsuite/
            PR fortran/97694
            PR fortran/97723
            * gfortran.dg/select_rank_5.f90: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/97723] type bound ASSIGNMENT(=) within select rank block wrongly rejected
  2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
                   ` (5 preceding siblings ...)
  2020-12-27 14:59 ` cvs-commit at gcc dot gnu.org
@ 2021-09-10 20:16 ` cvs-commit at gcc dot gnu.org
  2021-09-10 20:23 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-10 20:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:25d45b5dd41a9ab005a5ae8ee8e54be17f2467a2

commit r10-10109-g25d45b5dd41a9ab005a5ae8ee8e54be17f2467a2
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Sun Dec 27 14:59:38 2020 +0000

    Fortran: Fix some select rank issues [PR97694 and 97723].

    2020-12-27  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/97694
            PR fortran/97723
            * check.c (allocatable_check): Select rank temporaries are
            permitted even though they are treated as associate variables.
            * resolve.c (gfc_resolve_code): Break on select rank as well as
            select type so that the block os resolved.
            * trans-stmt.c (trans_associate_var): Class associate variables
            that are optional dummies must use the backend_decl.

    gcc/testsuite/
            PR fortran/97694
            PR fortran/97723
            * gfortran.dg/select_rank_5.f90: New test.

    (cherry picked from commit c4a678981572c12d158709ace0d3f23dd04cf217)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/97723] type bound ASSIGNMENT(=) within select rank block wrongly rejected
  2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
                   ` (6 preceding siblings ...)
  2021-09-10 20:16 ` cvs-commit at gcc dot gnu.org
@ 2021-09-10 20:23 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-10 20:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97723

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |anlauf at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #7 from anlauf at gcc dot gnu.org ---
Backported Paul's fix to 10-branch after verifying that it does the job.

The backport to 9-branch would require more work, thus not done.  Closing.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-10 20:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05  7:20 [Bug fortran/97723] New: type bound ASSIGNMENT(=) within select rank block wrongly rejected mscfd at gmx dot net
2020-12-10 15:57 ` [Bug fortran/97723] " pault at gcc dot gnu.org
2020-12-10 15:58 ` pault at gcc dot gnu.org
2020-12-10 16:28 ` pault at gcc dot gnu.org
2020-12-11 13:53 ` pault at gcc dot gnu.org
2020-12-11 18:01 ` dominiq at lps dot ens.fr
2020-12-27 14:59 ` cvs-commit at gcc dot gnu.org
2021-09-10 20:16 ` cvs-commit at gcc dot gnu.org
2021-09-10 20:23 ` anlauf at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).