Re: [C/C++ PATCH] Fix -Wshift-overflow with sign bit

2015-08-22 Thread Jason Merrill
OK. Jason

Re: [C/C++ PATCH] Fix -Wshift-overflow with sign bit

2015-08-12 Thread Jeff Law
On 08/12/2015 11:40 AM, Marek Polacek wrote: On Wed, Aug 12, 2015 at 11:33:21AM -0600, Jeff Law wrote: On 08/12/2015 11:28 AM, Toon Moene wrote: https://gcc.gnu.org/ml/gcc-testresults/2015-08/msg01036.html [ Yes, that's at run time, not compile time ... ] Hoping some of those are fixed by the

Re: [C/C++ PATCH] Fix -Wshift-overflow with sign bit

2015-08-12 Thread Marek Polacek
On Wed, Aug 12, 2015 at 11:33:21AM -0600, Jeff Law wrote: > On 08/12/2015 11:28 AM, Toon Moene wrote: > >https://gcc.gnu.org/ml/gcc-testresults/2015-08/msg01036.html > > > >[ Yes, that's at run time, not compile time ... ] > Hoping some of those are fixed by the sext_hwi changes from Mikael. I hop

Re: [C/C++ PATCH] Fix -Wshift-overflow with sign bit

2015-08-12 Thread Jeff Law
On 08/12/2015 11:28 AM, Toon Moene wrote: On 08/12/2015 05:39 PM, Marek Polacek wrote: This patch fixes a defect in -Wshift-overflow. We should only warn about left-shifting 1 into the sign bit when -Wshift-overflow=2. But this doesn't apply only for 1 << 31, but also for 2 << 30, etc. In C++

Re: [C/C++ PATCH] Fix -Wshift-overflow with sign bit

2015-08-12 Thread Toon Moene
On 08/12/2015 05:39 PM, Marek Polacek wrote: This patch fixes a defect in -Wshift-overflow. We should only warn about left-shifting 1 into the sign bit when -Wshift-overflow=2. But this doesn't apply only for 1 << 31, but also for 2 << 30, etc. In C++14, never warn about this. And then there

Re: [C/C++ PATCH] Fix -Wshift-overflow with sign bit

2015-08-12 Thread Jeff Law
On 08/12/2015 09:39 AM, Marek Polacek wrote: This patch fixes a defect in -Wshift-overflow. We should only warn about left-shifting 1 into the sign bit when -Wshift-overflow=2. But this doesn't apply only for 1 << 31, but also for 2 << 30, etc. In C++14, never warn about this. Neither existing

[C/C++ PATCH] Fix -Wshift-overflow with sign bit

2015-08-12 Thread Marek Polacek
This patch fixes a defect in -Wshift-overflow. We should only warn about left-shifting 1 into the sign bit when -Wshift-overflow=2. But this doesn't apply only for 1 << 31, but also for 2 << 30, etc. In C++14, never warn about this. Neither existing tests nor documentation require updating, I th