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

            Bug ID: 120139
           Summary: -fc-prototypes emits incorrect type for arrays with
                    variable extents
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ryan.gambord at oregonstate dot edu
  Target Milestone: ---

MRE comparison between 14.2 and 15.1: https://godbolt.org/z/bnrYKEv7n

The following code,

-------------------------------------
module mymod
  use, intrinsic :: ISO_C_BINDING
contains
  subroutine f(a, b) BIND(C)
    integer(C_INT), intent(in), value :: a
    integer(C_INT), intent(in) :: b(a)
  end subroutine f
end module mymod
-------------------------------------

Emits,

void f (int a, const int b);   /* gfortran 15.1 onward !INCORRECT */

void f (int a, const int *b);  /* gfortran 14.2 */

Reply via email to