All throughout history, GCC has had a -fno-strict-overflow option.
Conversation
Replying to
supporting both this and -fwrapv is the sort of mental contortion only a compiler developer could love
3
14
and then throw in -ftrapv which never quite seemed to reach the level of best-effort trapping but was rather more of a halfhearted decision to trap when the moon was in a certain phase
1
3
I don't know of any real problems with this, it has been turned on in parts of Android releases for at least a few years
1
3
well, carefully selected parts of it have been turned on, probably just the integer overflow stuff
2
3
They've started using -fsanitize=bounds in Android 11:
security.googleblog.com/2020/06/system
This covers it being introduced in Android N:
android-developers.googleblog.com/2016/05/harden
This has a section on expanding and optimizing it for Android P:
android-developers.googleblog.com/2018/06/compil



