File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -924,13 +924,15 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
924
924
if ( t12 && t12->is_con () ) { // Shift is by a constant
925
925
int shift = t12->get_con ();
926
926
shift &= BitsPerJavaLong - 1 ; // semantics of Java shifts
927
- const julong sign_bits_mask = ~(((julong)CONST64 (1 ) << (julong)(BitsPerJavaLong - shift)) -1 );
928
- // If the AND'ing of the 2 masks has no bits, then only original shifted
929
- // bits survive. NO sign-extension bits survive the maskings.
930
- if ( (sign_bits_mask & mask) == 0 ) {
931
- // Use zero-fill shift instead
932
- Node *zshift = phase->transform (new URShiftLNode (in1->in (1 ), in1->in (2 )));
933
- return new AndLNode (zshift, in (2 ));
927
+ if (shift != 0 ) {
928
+ const julong sign_bits_mask = ~(((julong)CONST64 (1 ) << (julong)(BitsPerJavaLong - shift)) -1 );
929
+ // If the AND'ing of the 2 masks has no bits, then only original shifted
930
+ // bits survive. NO sign-extension bits survive the maskings.
931
+ if ( (sign_bits_mask & mask) == 0 ) {
932
+ // Use zero-fill shift instead
933
+ Node *zshift = phase->transform (new URShiftLNode (in1->in (1 ), in1->in (2 )));
934
+ return new AndLNode (zshift, in (2 ));
935
+ }
934
936
}
935
937
}
936
938
}
You can’t perform that action at this time.
0 commit comments