[clang] [Clang] Overflow Idiom Exclusions (PR #100272)

Justin Stitt via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 23 16:36:06 PDT 2024


JustinStitt wrote:

> I assume you are going to change fronted to avoid compiler abusing these UBs?

Well, like you said, none of this is really undefined behavior and isn't getting optimized away. The exception being `if ( a + b < a )` which can definitely have some unexpected results with higher optimization levels. Users can opt into `-fno-strict-overflow` (like the Linux Kernel). I don't think `-fno-sanitize-overflow-idioms` should imply `-fno-strict-overflow`. It's up to the user there, right?

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


More information about the cfe-commits mailing list