Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect information when the type-spec for the dimension of the function result contains the UBOUND intrinsic. #1421

Closed
wanbinchen-hnc opened this issue Sep 25, 2023 · 2 comments

Comments

@wanbinchen-hnc
Copy link
Contributor

This test case is extended from gfortran.dg/pr69739.f90

program p
  implicit none
  integer :: x(2,3,4)
  integer, allocatable :: y(:)

  y = foo(x)
  print *, size(y)
contains
  function foo(a)
    integer :: a(:, :, :)
    integer :: foo(1:product(ubound(a)))
    print *, size(foo)
    foo = 1
  end function
end program

gfortran output:

          24
          24

flang output:

            0
            0
@wanbinchen-hnc
Copy link
Contributor Author

wanbinchen-hnc commented Sep 25, 2023

PR #1422 fixes this issue, please have a look.

@bryanpkc
Copy link
Collaborator

#1422 has been merged. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants