[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 00:27:57 PDT 2024


https://github.com/nikic commented:

As a high level comment: Do we need to pass through the nuw flag, rather than deriving it from signedIndices?

Basically, I think that we should be emitting nuw if and only if `-fsanitize=undefined` would perform a check for unsigned overflow for that gep, and the information to determine whether that is done should already be available in the relevant places.

(Unless we currently perform incorrect sanitizer checks in some cases -- in which case that needs to be fixed.)

https://github.com/llvm/llvm-project/pull/103088


More information about the cfe-commits mailing list