Skip to content

CIR generated LLVM code for pointer arithmetic misses inbounds  #952

@ghehg

Description

@ghehg

sample code
void foo(int *iptr) { iptr + 2; }

Clang generated code:
https://godbolt.org/z/8Yjnhxhz4
where we have
getelementptr inbounds i32, ptr %0, i64 2
CIR generated LLVM code is like
https://godbolt.org/z/Wzdcvea46
where we see
getelementptr i32, ptr %3, i64 2,
We are missing inbounds here.

Metadata

Metadata

Assignees

Labels

IR differenceA difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen testsgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions