mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-16 00:19:27 +00:00
8157758: JDK9 does not compile on Linux with GCC 6.1 because left-shifting a negative number has undefined behavior
Replace shifts of -1 with shifts of ~0u. Reviewed-by: kbarrett, mockner
This commit is contained in:
parent
dd9f85e74d
commit
4abb5e4aaf
@ -168,7 +168,7 @@ class Dependencies: public ResourceObj {
|
||||
LG2_TYPE_LIMIT = 4, // assert(TYPE_LIMIT <= (1<<LG2_TYPE_LIMIT))
|
||||
|
||||
// handy categorizations of dependency types:
|
||||
all_types = ((1 << TYPE_LIMIT) - 1) & ((-1) << FIRST_TYPE),
|
||||
all_types = ((1 << TYPE_LIMIT) - 1) & ((~0u) << FIRST_TYPE),
|
||||
|
||||
non_klass_types = (1 << call_site_target_value),
|
||||
klass_types = all_types & ~non_klass_types,
|
||||
|
||||
@ -193,7 +193,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
field_index_mask = right_n_bits(field_index_bits),
|
||||
parameter_size_bits = 8, // subset of field_index_mask, range is 0..255
|
||||
parameter_size_mask = right_n_bits(parameter_size_bits),
|
||||
option_bits_mask = ~(((-1) << tos_state_shift) | (field_index_mask | parameter_size_mask))
|
||||
option_bits_mask = ~(((~0u) << tos_state_shift) | (field_index_mask | parameter_size_mask))
|
||||
};
|
||||
|
||||
// specific bit definitions for the indices field:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user