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

[Flang] Compile error when component-name declared in declaration-type-spec (class) with pointer attribute is used as an argument to entry statement #132648

Open
ohno-fj opened this issue Mar 23, 2025 · 1 comment
Labels

Comments

@ohno-fj
Copy link

ohno-fj commented Mar 23, 2025

Version of flang : 21.0.0(3e6f618e86f5fbad2c2d5802416ec3d3366a2837)/AArch64

When component-name (cy1) declared in declaration-type-spec (class) with pointer attribute is used as an argument to entry statement, a compilation error occurs.

The following are the test program, Flang, Gfortran and ifx compilation/execution result.

snggr249_22.f90:

module m3
  type x1
     integer::ix1
  end type x1
  type,extends(x1)::x2
  end type x2
  type,extends(x2)::x3
  end type x3
  class(x1),pointer,dimension(:)::cy1
contains
  subroutine dummy()
  entry      chk(c1)
   class(x1),dimension(3)::c1
 end subroutine dummy
end module m3

subroutine s1
  use m3
  type(x1),target::ty1(3)
  ty1%ix1=[1,2,3]
  cy1=>ty1
  call chk(cy1)
end subroutine s1

program main
  call s1
  print *,'pass'
end program main
$ flang snggr249_22.f90
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/PETA_V1020_PT3_FFE02/snggr249_22.f90":13:28): 'hlfir.declare' op for box address must not have a shape operand
error: verification of lowering to FIR failed
$
$ gfortran snggr249_22.f90; ./a.out
 pass
$
$ ifx snggr249_22.f90; ./a.out
 pass
$
@ohno-fj ohno-fj added the flang Flang issues not falling into any other category label Mar 23, 2025
@EugeneZelenko EugeneZelenko added flang:ir and removed flang Flang issues not falling into any other category labels Mar 24, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 24, 2025

@llvm/issue-subscribers-flang-ir

Author: None (ohno-fj)

``` Version of flang : 21.0.0(3e6f618)/AArch64 ``` When `component-name (cy1)` declared in `declaration-type-spec (class)` with `pointer attribute` is used as an argument to `entry statement`, a compilation error occurs.

The following are the test program, Flang, Gfortran and ifx compilation/execution result.

snggr249_22.f90:

module m3
  type x1
     integer::ix1
  end type x1
  type,extends(x1)::x2
  end type x2
  type,extends(x2)::x3
  end type x3
  class(x1),pointer,dimension(:)::cy1
contains
  subroutine dummy()
  entry      chk(c1)
   class(x1),dimension(3)::c1
 end subroutine dummy
end module m3

subroutine s1
  use m3
  type(x1),target::ty1(3)
  ty1%ix1=[1,2,3]
  cy1=>ty1
  call chk(cy1)
end subroutine s1

program main
  call s1
  print *,'pass'
end program main
$ flang snggr249_22.f90
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/PETA_V1020_PT3_FFE02/snggr249_22.f90":13:28): 'hlfir.declare' op for box address must not have a shape operand
error: verification of lowering to FIR failed
$
$ gfortran snggr249_22.f90; ./a.out
 pass
$
$ ifx snggr249_22.f90; ./a.out
 pass
$

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

No branches or pull requests

3 participants