[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 --- Comment #11 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:76a45931ab7c831e32cebf13a6317e5e142f8151 commit r12-6261-g76a45931ab7c831e32cebf13a6317e5e142f8151 Author: Jonathan Wakely

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-05 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 --- Comment #10 from Jakub Jelinek --- Please rerun that command with -c -o test_allheaders_allheaders.o replaced with -E -dD -o test_allheaders_allheaders.ii Then compress it and attach here.

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 --- Comment #9 from Jonathan Wakely --- Either that isn't the correct g++ command, or something in the code you're compiling uses "#pragma GCC diagnostic error ..." to enable the warning. There is no way to get an *error* from a non-default

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-04 Thread stefan.bruens--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 --- Comment #8 from Stefan BrĂ¼ns --- (In reply to Jonathan Wakely from comment #2) > This is not a bug. > > Firstly, there's no testcase provided (as https://gcc.gnu.org/bugs says is > needed). Here's the missing testcase: > > #include >

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 --- Comment #7 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #4) > (In reply to Jakub Jelinek from comment #3) > > Other options perhaps could be - (__x._M_node ? 1 : 0) > > That produces worse code (with a jump) at -O1

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 --- Comment #6 from Jakub Jelinek --- (In reply to Jonathan Wakely from comment #4) > > or - 1 + !__x._M_node > > Isn't that undefined for (x - y - 1 + !x) if x and y are both null? > We get (T*)0 - 1 + 1 which overflows twice. You're right,

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 --- Comment #5 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #4) > We get (T*)0 - 1 + 1 which overflows twice. GCC's ubsan doesn't diagnose this, but Clang's does.

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 --- Comment #4 from Jonathan Wakely --- (In reply to Jakub Jelinek from comment #3) > Other options perhaps could be - (__x._M_node ? 1 : 0) That produces worse code (with a jump) at -O1 > or - 1 + !__x._M_node Isn't that undefined for (x -

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 Jonathan Wakely changed: What|Removed |Added Priority|P2 |P3 Target Milestone|11.0

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2022-01-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 Richard Biener changed: What|Removed |Added Priority|P3 |P2

[Bug libstdc++/103848] [11/12 Regression] std::deque<>::iterator operator- uses "0" for nullptr check, triggers "zero-as-null-pointer-constant" warning

2021-12-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2021-12-28