--- old/src/share/vm/c1/c1_LIRGenerator.cpp Fri Nov 7 12:06:54 2008 +++ new/src/share/vm/c1/c1_LIRGenerator.cpp Fri Nov 7 12:06:53 2008 @@ -1210,8 +1210,8 @@ break; case T_LONG: case T_DOUBLE: - if (c->as_jint_hi_bits() != other->as_jint_lo_bits()) continue; - if (c->as_jint_lo_bits() != other->as_jint_hi_bits()) continue; + if (c->as_jint_hi_bits() != other->as_jint_hi_bits()) continue; + if (c->as_jint_lo_bits() != other->as_jint_lo_bits()) continue; break; case T_OBJECT: if (c->as_jobject() != other->as_jobject()) continue; --- /dev/null Fri Nov 7 12:06:21 2008 +++ new/test/compiler/6757316/Test6757316.java Fri Nov 7 12:06:55 2008 @@ -0,0 +1,20 @@ +/** + * @test + * @bug 6757316 + * @summary load_constant() produces a wrong long constant, with high a low words swapped + * @run main/othervm -Xcomp Test6757316 + */ + +public class Test6757316 { + public static void main(String[] args) { + long[] arr = { + 0x11111111aaaaaaaaL, + 0xaaaaaaaa11111111L, + 0x11111111aaaaaaaaL, + 0xaaaaaaaa11111111L + }; + if (arr[0] == arr[1]) { + throw new InternalError(); + } + } +}