Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8263425: AArch64: two potential bugs in C1 LIRGenerator::generate_add…
…ress()

Reviewed-by: aph
  • Loading branch information
nick-arm committed Mar 15, 2021
1 parent 554dd29 commit f7e0a09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp
Expand Up @@ -174,7 +174,7 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
if (large_disp != 0) {
LIR_Opr tmp = new_pointer_register();
if (Assembler::operand_valid_for_add_sub_immediate(large_disp)) {
__ add(tmp, tmp, LIR_OprFact::intptrConst(large_disp));
__ add(index, LIR_OprFact::intptrConst(large_disp), tmp);
index = tmp;
} else {
__ move(tmp, LIR_OprFact::intptrConst(large_disp));
Expand All @@ -191,7 +191,7 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
}

// at this point we either have base + index or base + displacement
if (large_disp == 0) {
if (large_disp == 0 && index->is_register()) {
return new LIR_Address(base, index, type);
} else {
assert(Address::offset_ok_for_immed(large_disp, 0), "must be");
Expand Down

0 comments on commit f7e0a09

Please sign in to comment.