Skip to content

[flang] [REGRESSION] EOSHIFT failed fir assertion #158382

@DanielCChen

Description

@DanielCChen

Consider the following code:

module m
    type :: Base
        integer i
    end type

    type, extends(Base) :: Child
        integer j
    end type
end module

program cshift002
use m
    class(base), pointer :: c1(:,:)
    class(base), allocatable :: res(:,:)

    allocate(c1(4,2), SOURCE=reshape((/(Child(i,-i),i=1,8)/),(/4,2/)))

    res = eoshift(c1,(/-2,1/), (/Child(11,-11),Child(12,-12)/))
end

Flang failed at lowering

error: loc("t.f":18:5): 'hlfir.eoshift' op ARRAY and BOUNDARY operands must have the same element type
error: verification of lowering to FIR failed

It seems a regression as the test case passed before.
It seems it no longer handles the polymorphic type of ARRAY and BOUNDARY.

Metadata

Metadata

Assignees

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]flang:fir-hlfir

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions