Skip to content

[flang][openmp] real(10) prevents compilation even when it is not used in device code #128015

Closed
@VeeEM

Description

@VeeEM

At least for amdgpu, code containing real(10) can no longer be compiled with offloading enabled after 2bfb3ba.

Compiling a program containing a real(10) variable used to print a warning, now it's an error:

program prog1
real(10) :: x
end program
$ flang-new -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa --offload-arch=gfx90a prog1.f90
error: Semantic errors in prog1.f90
./prog1.f90:2:1: error: REAL(KIND=10) is not an enabled type for this target
  real(10) :: x
  ^^^^^^^^^^^^^

Using a module containing real(10) is also an error now, previously this did not even print a warning:

module m
contains
subroutine f(x)
real(10) :: x
end subroutine
end module
program prog2
use m
end program
$ flang-new -c m.f90
$ flang-new -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa --offload-arch=gfx90a prog2.f90
error: Semantic errors in prog2.f90
./m.mod:5:1: error: REAL(KIND=10) is not an enabled type for this target
  real(10)::x
  ^^^^^^^^^^^

I'm thinking real(10) should probably only be an error if used on device.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions