Skip to content

[InstCombine] Crash on valid input when narrowing type but not updating range attribute #112633

Closed
@goldsteinn

Description

@goldsteinn

https://godbolt.org/z/b3M1dj6aj

define void @SetRow_C(ptr %p, i32 %conv) {
entry:
  %call.i = tail call ptr @__memset_chk(ptr %p, i32 range(i32 0, 123) %conv, i64 1, i64 1)
  ret void
}

declare ptr @__memset_chk(ptr, i32, i64, i64)

We keep the range(i32 ...) when we replace the _chk with memset.inline.p0.i64 which leads to a crash:

Range bit width must match type bit width!
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %p, i8 range(i32 0, 250) %0, i64 1, i1 false)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions