Skip to content

-fwrapv-pointer doesn't affect member accesses #132449

Closed
@efriedma-quic

Description

@efriedma-quic

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 .

CC @dtcxzyw @nikic

Metadata

Metadata

Assignees

Labels

clang:codegenIR generation bugs: mangling, exceptions, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions