public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set
@ 2020-03-25 13:18 jrfsousa at gmail dot com
  2020-03-25 13:19 ` [Bug fortran/94327] " jrfsousa at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jrfsousa at gmail dot com @ 2020-03-25 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94327
           Summary: Bind(c) argument attributes are incorrectly set
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jrfsousa at gmail dot com
  Target Milestone: ---

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

Hi all!

Argument attributes should match the dummy argument attribute not the effective
argument's.

Found in both:

GNU Fortran (GCC) 9.3.1 20200324

and

GNU Fortran (GCC) 10.0.1 20200324 (experimental)

Thank you very much.

Best regards,
José Rui

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

* [Bug fortran/94327] Bind(c) argument attributes are incorrectly set
  2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
@ 2020-03-25 13:19 ` jrfsousa at gmail dot com
  2020-07-26 16:32 ` dominiq at lps dot ens.fr
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jrfsousa at gmail dot com @ 2020-03-25 13:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from José Rui Faustino de Sousa <jrfsousa at gmail dot com> ---
Created attachment 48113
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48113&action=edit
C code demonstrating problems.

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

* [Bug fortran/94327] Bind(c) argument attributes are incorrectly set
  2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
  2020-03-25 13:19 ` [Bug fortran/94327] " jrfsousa at gmail dot com
@ 2020-07-26 16:32 ` dominiq at lps dot ens.fr
  2021-05-19 18:07 ` jrfsousa at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-07-26 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-07-26

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed. From GCC9 up to GCC11 the test stop with 21 and 32, cfi_p being 0.

GCC7 and 8 fail with

Assertion failed: (this->elem_len==4), function attribute, file pr94327.c, line
89.

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

* [Bug fortran/94327] Bind(c) argument attributes are incorrectly set
  2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
  2020-03-25 13:19 ` [Bug fortran/94327] " jrfsousa at gmail dot com
  2020-07-26 16:32 ` dominiq at lps dot ens.fr
@ 2021-05-19 18:07 ` jrfsousa at gcc dot gnu.org
  2021-05-30 20:07 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jrfsousa at gcc dot gnu.org @ 2021-05-19 18:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from José Rui Faustino de Sousa <jrfsousa at gcc dot gnu.org> ---
Patch posted:

https://gcc.gnu.org/pipermail/fortran/2021-May/056054.html

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

* [Bug fortran/94327] Bind(c) argument attributes are incorrectly set
  2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
                   ` (2 preceding siblings ...)
  2021-05-19 18:07 ` jrfsousa at gcc dot gnu.org
@ 2021-05-30 20:07 ` dominiq at lps dot ens.fr
  2021-06-14 23:20 ` jrfsousa at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-05-30 20:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Patch posted:
>
> https://gcc.gnu.org/pipermail/fortran/2021-May/056054.html

The patch fixes this PR, see also pr94331.

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

* [Bug fortran/94327] Bind(c) argument attributes are incorrectly set
  2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
                   ` (3 preceding siblings ...)
  2021-05-30 20:07 ` dominiq at lps dot ens.fr
@ 2021-06-14 23:20 ` jrfsousa at gcc dot gnu.org
  2021-06-14 23:21 ` jrfsousa at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jrfsousa at gcc dot gnu.org @ 2021-06-14 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from José Rui Faustino de Sousa <jrfsousa at gcc dot gnu.org> ---
Updated patch:

https://gcc.gnu.org/pipermail/fortran/2021-June/056163.html

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

* [Bug fortran/94327] Bind(c) argument attributes are incorrectly set
  2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
                   ` (4 preceding siblings ...)
  2021-06-14 23:20 ` jrfsousa at gcc dot gnu.org
@ 2021-06-14 23:21 ` jrfsousa at gcc dot gnu.org
  2021-07-26 12:33 ` cvs-commit at gcc dot gnu.org
  2021-10-19 10:24 ` burnus at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jrfsousa at gcc dot gnu.org @ 2021-06-14 23:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from José Rui Faustino de Sousa <jrfsousa at gcc dot gnu.org> ---
Created attachment 51016
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51016&action=edit
Updated patch.

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

* [Bug fortran/94327] Bind(c) argument attributes are incorrectly set
  2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
                   ` (5 preceding siblings ...)
  2021-06-14 23:21 ` jrfsousa at gcc dot gnu.org
@ 2021-07-26 12:33 ` cvs-commit at gcc dot gnu.org
  2021-10-19 10:24 ` burnus at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-26 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:0cbf03689e3e7d9d6002b8e5d159ef3716d0404c

commit r12-2511-g0cbf03689e3e7d9d6002b8e5d159ef3716d0404c
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon Jul 26 14:20:46 2021 +0200

    PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor
handling

    Fortran: Fix attributes and bounds in ISO_Fortran_binding.

    2021-07-26  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
                Tobias Burnus  <tobias@codesourcery.com>

            PR fortran/93308
            PR fortran/93963
            PR fortran/94327
            PR fortran/94331
            PR fortran/97046

    gcc/fortran/ChangeLog:

            * trans-decl.c (convert_CFI_desc): Only copy out the descriptor
            if necessary.
            * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Updated attribute
            handling which reflect a previous intermediate version of the
            standard. Only copy out the descriptor if necessary.

    libgfortran/ChangeLog:

            * runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Add code
            to verify the descriptor. Correct bounds calculation.
            (gfc_desc_to_cfi_desc): Add code to verify the descriptor.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/ISO_Fortran_binding_1.f90: Add pointer attribute,
            this test is still erroneous but now it compiles.
            * gfortran.dg/bind_c_array_params_2.f90: Update regex to match
            code changes.
            * gfortran.dg/PR93308.f90: New test.
            * gfortran.dg/PR93963.f90: New test.
            * gfortran.dg/PR94327.c: New test.
            * gfortran.dg/PR94327.f90: New test.
            * gfortran.dg/PR94331.c: New test.
            * gfortran.dg/PR94331.f90: New test.
            * gfortran.dg/PR97046.f90: New test.

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

* [Bug fortran/94327] Bind(c) argument attributes are incorrectly set
  2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
                   ` (6 preceding siblings ...)
  2021-07-26 12:33 ` cvs-commit at gcc dot gnu.org
@ 2021-10-19 10:24 ` burnus at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-10-19 10:24 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

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

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Close as FIXED.

Except for the version == 0 which should be version == 1, as #define
CFI_VERSION 1,
the testcase of comment 0 (Fortran part) and comment 1 (C part) do pass now.

Thanks for bug reports José and your patch(es)!

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

end of thread, other threads:[~2021-10-19 10:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 13:18 [Bug fortran/94327] New: Bind(c) argument attributes are incorrectly set jrfsousa at gmail dot com
2020-03-25 13:19 ` [Bug fortran/94327] " jrfsousa at gmail dot com
2020-07-26 16:32 ` dominiq at lps dot ens.fr
2021-05-19 18:07 ` jrfsousa at gcc dot gnu.org
2021-05-30 20:07 ` dominiq at lps dot ens.fr
2021-06-14 23:20 ` jrfsousa at gcc dot gnu.org
2021-06-14 23:21 ` jrfsousa at gcc dot gnu.org
2021-07-26 12:33 ` cvs-commit at gcc dot gnu.org
2021-10-19 10:24 ` burnus 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).