Skip to content

[flang] Improper casting of integer(2) selector for computed gotos #153050

@VijayKandiah

Description

@VijayKandiah

Reproducer:

program test
    implicit none
    integer(2) :: ix
    
    ix = 1
    goto(10) ix
  10 continue
    print *, 'success'
    
end program test
$ flang test.f90 
flang: llvm-project/llvm/lib/IR/Instructions.cpp:3041: static CastInst *llvm::CastInst::Create(Instruction::CastOps, Value *, Type *, const Twine &, InsertPosition): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

Changing the selector ix's type to integer(4) works but using type integer(2) does not.

Metadata

Metadata

Assignees

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]flang:ir

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions