RFR: 8240259: Disable -Wshift-negative-value warnings
Ioi Lam
ioi.lam at oracle.com
Fri May 29 00:23:53 UTC 2020
Looks good to me. When I enabled c++14 in gcc, I had to do a few of
these manually and didn't see any test failures, so I think the gcc
warning isn't really catching anything bad in our code.
Thanks
- Ioi
Node* RShiftINode::Identity(PhaseGVN* phase) {
...
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshift-negative-value"
#endif
int lo = (-1 << (BitsPerJavaInteger - ((uint)shift)-1)); // FFFF8000
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
and the VM passed
On 5/22/20 1:23 AM, Kim Barrett wrote:
>> On May 22, 2020, at 3:38 AM, Magnus Ihse Bursie <magnus.ihse.bursie at oracle.com> wrote:
>>
>> Looks good to me.
> Thanks.
>
>> /Magnus
>>
>> On 2020-05-22 03:54, Kim Barrett wrote:
>>> Please review this change which disables warnings for left shift of a
>>> negative value when compiling HotSpot with gcc or clang. This warning
>>> isn't helpful, given that all compilers seem to do the obvious thing,
>>> and that obvious thing will soon-ish (C++20) be the specified thing.
>>> See the CR for more details.
>>>
>>> CR:
>>> https://bugs.openjdk.java.net/browse/JDK-8240259
>>>
>>> Webrev:
>>> https://cr.openjdk.java.net/~kbarrett/8240259/open.00/
>>>
>>> Testing:
>>> mach5 tier1. Also tier1-5 with C++14 enabled.
>>>
>>> Note that there are already occurrences of left shift of negative
>>> values in our code, with no apparent consequences, even when testing
>>> with C++11/14 enabled.
>
More information about the hotspot-dev
mailing list