Skip to content

[Flang][OpenMP] reduction on logical array causes LLVM IR type mismatch #145219

Open
@k-arrows

Description

@k-arrows

Reproducer:
https://godbolt.org/z/MM1hjbEjr

logical :: l1, l2(2)

!$omp parallel reduction (.and.:l1, l2)
l1 = .false.
l2(2) = .false.
!$omp end parallel
end
flang-21: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
Intrinsic has incorrect argument type!
ptr @llvm.memcpy.p0.i32.i32
Both operands to ICmp instruction are not of the same type!
  %28 = icmp ne ptr %1, i32 0
error: failed to create the LLVM module
Compiler returned: 1

With assertion-enabled flang, compiling the above reproducer results in the following assertion failure:

llvm-project/llvm/include/llvm/IR/Instructions.h:1182: void llvm::ICmpInst::AssertOK(): Assertion `getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"' failed.

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