public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
@ 2021-01-11 16:18 ` burnus at gcc dot gnu.org
  2021-01-16 13:03 ` burnus at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-01-11 16:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Also related to this issue:
https://gcc.gnu.org/pipermail/fortran/2021-January/055581.html:

In my understanding (see linked email and spec quote in comment 0),
CFI_type_signed_char is an integer type – and, hence, it should not be handled
at the following place – as pointed out by Harris Snyder in that email:

'CFI_establish' in libgfortran/runtime/ISO_Fortran_binding.c, circa line 348:

  if (type == CFI_type_char || type == CFI_type_ucs4_char ||
      type == CFI_type_signed_char || type == CFI_type_struct ||
      type == CFI_type_other)
    dv->elem_len = elem_len;


The value is later used for the stride multiplier (sm) – hence, it causes
problems if it is set wrongly (to 0).

TESTCASE: See linked email.

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

* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
  2021-01-11 16:18 ` [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set? burnus at gcc dot gnu.org
@ 2021-01-16 13:03 ` burnus at gcc dot gnu.org
  2021-01-16 13:05 ` dominiq at lps dot ens.fr
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-01-16 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #1)
> Also related to this issue:
> https://gcc.gnu.org/pipermail/fortran/2021-January/055581.html:

A patch for this issue was submitted at
  https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563399.html
and committed to mainline (GCC 11) as
  https://gcc.gnu.org/g:b90e4a97419ce91fd7c1628b5912e8f54bee3441
(plus a follow-up ChangeLog fix).

The issue of comment 0 remains.

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

* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
  2021-01-11 16:18 ` [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set? burnus at gcc dot gnu.org
  2021-01-16 13:03 ` burnus at gcc dot gnu.org
@ 2021-01-16 13:05 ` dominiq at lps dot ens.fr
  2021-01-28  7:33 ` tkoenig at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-01-16 13:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-01-16
             Status|UNCONFIRMED                 |NEW

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

* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-01-16 13:05 ` dominiq at lps dot ens.fr
@ 2021-01-28  7:33 ` tkoenig at gcc dot gnu.org
  2021-06-22 19:46 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2021-01-28  7:33 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

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

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
A related patch was applied at

https://gcc.gnu.org/g:1cdca4261e88f4dc9c3293c6b3c2fff3071ca32b .

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

* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-01-28  7:33 ` tkoenig at gcc dot gnu.org
@ 2021-06-22 19:46 ` cvs-commit at gcc dot gnu.org
  2021-06-22 19:52 ` sandra at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-22 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sandra Loosemore <sandra@gcc.gnu.org>:

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

commit r12-1733-gf61e5d4d8b6d4cfa96863187fa61b8c6b057a491
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Tue Jun 22 12:42:17 2021 -0700

    Fortran: fix sm computation in CFI_allocate [PR93524]

    This patch fixes a bug in setting the step multiplier field in the
    C descriptor for array dimensions > 2.

    2021-06-21  Sandra Loosemore  <sandra@codesourcery.com>
                Tobias Burnus  <tobias@codesourcery.com>

    libgfortran/
            PR fortran/93524
            * runtime/ISO_Fortran_binding.c (CFI_allocate): Fix
            sm computation.

    gcc/testsuite/
            PR fortran/93524
            * gfortran.dg/pr93524.c: New.
            * gfortran.dg/pr93524.f90: New.

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

* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-06-22 19:46 ` cvs-commit at gcc dot gnu.org
@ 2021-06-22 19:52 ` sandra at gcc dot gnu.org
  2021-06-24  1:00 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-06-22 19:52 UTC (permalink / raw)
  To: gcc-bugs

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

sandra at gcc dot gnu.org changed:

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

--- Comment #5 from sandra at gcc dot gnu.org ---
I've checked in a patch that fixes the problem in the description, and I think
that none of the other bugs reported in other comments are still present.

I think this patch ought to be backported to GCC 11 and possibly other branches
as well, since it's a pretty small bug fix.  What branches have similar fixes
for C interoperability features been going on?

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

* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-06-22 19:52 ` sandra at gcc dot gnu.org
@ 2021-06-24  1:00 ` cvs-commit at gcc dot gnu.org
  2021-06-24  1:07 ` sandra at gcc dot gnu.org
  2021-08-31 10:55 ` burnus at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-24  1:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Sandra Loosemore
<sandra@gcc.gnu.org>:

https://gcc.gnu.org/g:1a2bbc08d9e5e4837d33afbb8c8347a182223a43

commit r11-8648-g1a2bbc08d9e5e4837d33afbb8c8347a182223a43
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Tue Jun 22 12:42:17 2021 -0700

    Fortran: fix sm computation in CFI_allocate [PR93524]

    Backported from trunk.

    This patch fixes a bug in setting the step multiplier field in the
    C descriptor for array dimensions > 2.

    2021-06-21  Sandra Loosemore  <sandra@codesourcery.com>
                Tobias Burnus  <tobias@codesourcery.com>

    libgfortran/
            PR fortran/93524
            * runtime/ISO_Fortran_binding.c (CFI_allocate): Fix
            sm computation.

    gcc/testsuite/
            PR fortran/93524
            * gfortran.dg/pr93524.c: New.
            * gfortran.dg/pr93524.f90: New.

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

* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-06-24  1:00 ` cvs-commit at gcc dot gnu.org
@ 2021-06-24  1:07 ` sandra at gcc dot gnu.org
  2021-08-31 10:55 ` burnus at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-06-24  1:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from sandra at gcc dot gnu.org ---
Now applied to GCC 11 too.  The other two patches referenced in this issue were
put on mainline before GCC 11 branched and not on GCC 10 or any older branch,
so I think I'm done here and the issue can be closed.

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

* [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set?
       [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2021-06-24  1:07 ` sandra at gcc dot gnu.org
@ 2021-08-31 10:55 ` burnus at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-08-31 10:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to sandra from comment #7)
> Now applied to GCC 11 too.  The other two patches referenced in this issue
> were put on mainline before GCC 11 branched and not on GCC 10 or any older
> branch, so I think I'm done here and the issue can be closed.

I concur → close as FIXED on GCC 12/mainline + GCC 11. Thanks!

(Related PR 92189, but separate issue and not triggered by the testcase.)

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

end of thread, other threads:[~2021-08-31 10:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93524-4@http.gcc.gnu.org/bugzilla/>
2021-01-11 16:18 ` [Bug fortran/93524] [ISO C Binding][F2018] CFI_allocate – elem_size mishandled + sm wrongly set? burnus at gcc dot gnu.org
2021-01-16 13:03 ` burnus at gcc dot gnu.org
2021-01-16 13:05 ` dominiq at lps dot ens.fr
2021-01-28  7:33 ` tkoenig at gcc dot gnu.org
2021-06-22 19:46 ` cvs-commit at gcc dot gnu.org
2021-06-22 19:52 ` sandra at gcc dot gnu.org
2021-06-24  1:00 ` cvs-commit at gcc dot gnu.org
2021-06-24  1:07 ` sandra at gcc dot gnu.org
2021-08-31 10:55 ` 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).