8214189: test/hotspot/jtreg/compiler/intrinsics/mathexact/MulExactLConstantTest.java fails on Windows x64 when run with -XX:-TieredCompilation
Reviewed-by: kvn
This commit is contained in:
parent
787f8b320e
commit
efcfec81ce
src/hotspot/share
test/hotspot/jtreg
@ -286,20 +286,20 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
|
||||
|
||||
// Check for negative constant; if so negate the final result
|
||||
bool sign_flip = false;
|
||||
unsigned long abs_con = uabs(con);
|
||||
if (abs_con != (unsigned long)con) {
|
||||
julong abs_con = uabs(con);
|
||||
if (abs_con != (julong)con) {
|
||||
sign_flip = true;
|
||||
}
|
||||
|
||||
// Get low bit; check for being the only bit
|
||||
Node *res = NULL;
|
||||
unsigned long bit1 = abs_con & (0-abs_con); // Extract low bit
|
||||
julong bit1 = abs_con & (0-abs_con); // Extract low bit
|
||||
if (bit1 == abs_con) { // Found a power of 2?
|
||||
res = new LShiftLNode(in(1), phase->intcon(log2_long(bit1)));
|
||||
} else {
|
||||
|
||||
// Check for constant with 2 bits set
|
||||
unsigned long bit2 = abs_con-bit1;
|
||||
julong bit2 = abs_con-bit1;
|
||||
bit2 = bit2 & (0-bit2); // Extract 2nd bit
|
||||
if (bit2 + bit1 == abs_con) { // Found all bits in con?
|
||||
Node *n1 = phase->transform(new LShiftLNode(in(1), phase->intcon(log2_long(bit1))));
|
||||
@ -308,7 +308,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
|
||||
|
||||
} else if (is_power_of_2_long(abs_con+1)) {
|
||||
// Sleezy: power-of-2 -1. Next time be generic.
|
||||
unsigned long temp = abs_con + 1;
|
||||
julong temp = abs_con + 1;
|
||||
Node *n1 = phase->transform( new LShiftLNode(in(1), phase->intcon(log2_long(temp))));
|
||||
res = new SubLNode(n1, in(1));
|
||||
} else {
|
||||
|
@ -1110,16 +1110,16 @@ static inline unsigned int uabs(unsigned int n) {
|
||||
if (value < 0) result = 0-result;
|
||||
return result;
|
||||
}
|
||||
static inline unsigned long uabs(unsigned long n) {
|
||||
static inline julong uabs(julong n) {
|
||||
union {
|
||||
unsigned long result;
|
||||
long value;
|
||||
julong result;
|
||||
jlong value;
|
||||
};
|
||||
result = n;
|
||||
if (value < 0) result = 0-result;
|
||||
return result;
|
||||
}
|
||||
static inline unsigned long uabs(jlong n) { return uabs((unsigned long)n); }
|
||||
static inline julong uabs(jlong n) { return uabs((julong)n); }
|
||||
static inline unsigned int uabs(int n) { return uabs((unsigned int)n); }
|
||||
|
||||
// "to" should be greater than "from."
|
||||
|
@ -61,8 +61,6 @@ compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all
|
||||
|
||||
compiler/runtime/Test8168712.java 8211769,8211771 generic-ppc64,generic-ppc64le,linux-s390x
|
||||
|
||||
compiler/intrinsics/mathexact/MulExactLConstantTest.java 8214189 windows-all
|
||||
|
||||
#############################################################################
|
||||
|
||||
# :hotspot_gc
|
||||
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Red Hat, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 8214189
|
||||
* @summary test/hotspot/jtreg/compiler/intrinsics/mathexact/MulExactLConstantTest.java fails on Windows x64 when run with -XX:-TieredCompilation
|
||||
*
|
||||
* @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement MultiplyByConstantLongMax
|
||||
*
|
||||
*/
|
||||
|
||||
public class MultiplyByConstantLongMax {
|
||||
public static void main(String[] args) {
|
||||
for (int i = 0; i < 20_000; i++) {
|
||||
if (test(1) != Long.MAX_VALUE) {
|
||||
throw new RuntimeException("incorrect result");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long test(long v) {
|
||||
return v * Long.MAX_VALUE;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user