[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2024-02-14 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #13

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2023-09-07 Thread qinzhao at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #12 from qinzhao at gcc dot gnu.org --- (In reply to Kees Cook from comment #11) > The trouble with "optimize" is that it just doesn't work. The kernel has > banned its use because it results in all other optimization options being >

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-23 Thread kees at outflux dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #11 from Kees Cook --- The trouble with "optimize" is that it just doesn't work. The kernel has banned its use because it results in all other optimization options being forgotten for the function in question.

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-14 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #10 from Jakub Jelinek --- The optimize attribute is how different options are represented in LTO compilation, so it grew over years from perhaps initial debugging use to something that is used everywhere. And we definitely aren't

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-14 Thread kees at outflux dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #9 from Kees Cook --- (In reply to Jakub Jelinek from comment #8) > So, instead (when building the kernel with sanitization) build with > -fsanitize=signed-integer-overflow and no -fno-strict-overflow, and > the routines where you

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-14 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #8 from Jakub Jelinek --- So, instead (when building the kernel with sanitization) build with -fsanitize=signed-integer-overflow and no -fno-strict-overflow, and the routines where you want wrapv behavior and not runtime traps build

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-14 Thread kees at outflux dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #7 from Kees Cook --- The problem the kernel needs to solve is basically having our cake and eating it too. :) In _most_ situations, we want signed overflows to trap (i.e. get caught by "-fsanitize=signed-integer-overflow"). In

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #6 from Jakub Jelinek --- That doesn't make sense. -fsanitize=signed-integer-overflow also removes that undefined behavior by defining what happens on signed integer overflow, one can choose whether to get a non-fatal runtime

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-13 Thread qing.zhao at oracle dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #5 from Qing Zhao --- > On Sep 13, 2021, at 4:45 PM, pinskia at gcc dot gnu.org > wrote: > >> is it possible to make -fsanitize=signed-integer-overflow work with -fwrapv? > > Why would it? they conflict. This is a feature that

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 Jakub Jelinek changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-13 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #3 from Andrew Pinski --- (In reply to qinzhao from comment #2) > (In reply to Andrew Pinski from comment #1) > > -fno-strict-overflow maps directly to -fwrapv . > > > > If you want to use -fsanitize=signed-integer-overflow, you

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-13 Thread qinzhao at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #2 from qinzhao at gcc dot gnu.org --- (In reply to Andrew Pinski from comment #1) > -fno-strict-overflow maps directly to -fwrapv . > > If you want to use -fsanitize=signed-integer-overflow, you can just remove > both

[Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow

2021-09-13 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102317 --- Comment #1 from Andrew Pinski --- -fno-strict-overflow maps directly to -fwrapv . If you want to use -fsanitize=signed-integer-overflow, you can just remove both -fno-strict-overflow -fwrapv. -fwrapv is implied for code later on.