Closed
Description
Compile the following with -fwrapv-pointer:
struct S { int x,y; };
int *a(struct S *x) { return &x->y; }
Produces getelementptr inbounds nuw %struct.S, ptr %0, i32 0, i32 1
... which seems counter to the premise of -fwrapv-pointer. And seems like it might be a problem with #130742 .
Activity
llvmbot commentedon Mar 22, 2025
@llvm/issue-subscribers-clang-codegen
Author: Eli Friedman (efriedma-quic)
Produces
getelementptr inbounds nuw %struct.S, ptr %0, i32 0, i32 1
... which seems counter to the premise of -fwrapv-pointer. And seems like it might be a problem with #130742 .CC @dtcxzyw @nikic
[Clang][CodeGen] Respect -fwrapv-pointer when emitting struct GEPs (l…
Automerge: [Clang][CodeGen] Respect -fwrapv-pointer when emitting str…
[Clang][CodeGen] Respect -fwrapv-pointer when emitting struct GEPs (l…
[Clang][CodeGen] Respect -fwrapv-pointer when emitting struct GEPs (l…