Skip to content

[flang][OpenMP] reduction(min) gives an inexact negative value close to zero #73101

Closed
@NimishMishra

Description

@NimishMishra

For the following program, logically, the variable x should give 0. However, LLVM flang gives an inexact negative value -1.E-45. In contrast, gfortran gives an exact 0.

program sample
   real :: x, y(100)
   x = 0
   do i = 1, 100
      y(i) = i
   end do

   !$omp parallel do reduction(min:x)
      do i = 1, 100
          x = min(y(i), x)
      end do
   !$omp end parallel do
end program sample

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions