[Bug sanitizer/79265] [7 regression] -fsanitize=undefined inserts unnecessary null pointer tests

2017-04-05 Thread sirl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79265

--- Comment #6 from Franz Sirl  ---
(In reply to Jakub Jelinek from comment #4)
> This is a new warning, the fact that we didn't warn on some code and now
> warn with a new warning is not necessarily a regression.

Well, I wasn't so sure either if it counts as a regression, that's why I asked
on IRC first and then changed it. If you feel otherwise, you can remove the
marker again.

I guess it is kind of a "usability regression":

- "gcc-6 -Wall -Werror": compiles
- "gcc-6 -Wall -Werror -fsanitize=undefined": compiles
- "gcc-7 -Wall -Werror": compiles
- "gcc-7 -Wall -Werror -fsanitize=undefined": doesn't compile because of false
warning

So it's no longer enough to "just add -fsanitize=undefined" and recompile, now
you have to adjust warnings as well.

If it can't be reasonably solved within the GCC-7 timeframe, I would be fine
with a stop-gap measure like removing -Wformat-overflow from -Wall when UBSAN
is active (for example).

[Bug sanitizer/79265] [7 regression] -fsanitize=undefined inserts unnecessary null pointer tests

2017-04-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79265

Jakub Jelinek  changed:

   What|Removed |Added

 CC||law at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
What we could do is disable jump threading basic blocks that contain the cold
sanitizer builtins, i.e. in between BEGIN_SANITIZER_BUILTINS and
END_SANITIZER_BUILTINS if they have cold attribute (which is really undesirable
in any case, such jump threading only grows the cold section unnecessarily).

Or move the warning earlier such that it doesn't warn on code after threading,
though that is likely not GCC7 material.

[Bug sanitizer/79265] [7 regression] -fsanitize=undefined inserts unnecessary null pointer tests

2017-04-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79265

--- Comment #4 from Jakub Jelinek  ---
This is a new warning, the fact that we didn't warn on some code and now warn
with a new warning is not necessarily a regression.

[Bug sanitizer/79265] [7 regression] -fsanitize=undefined inserts unnecessary null pointer tests

2017-04-05 Thread sirl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79265

Franz Sirl  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-05
Summary|-fsanitize=undefined|[7 regression]
   |inserts unnecessary null|-fsanitize=undefined
   |pointer tests   |inserts unnecessary null
   ||pointer tests
 Ever confirmed|0   |1

--- Comment #3 from Franz Sirl  ---
Code that used to compile warning-free with "gcc-6 -Wall -fsanitize=undefined"
now throws a warning with current gcc-7.0.1.