diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2024-10-11 10:28:38 +0200 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2024-10-13 16:56:36 +0200 |
commit | f0f11559d569faffacea63db5c4a5ad98335c4ad (patch) | |
tree | 0295220b19aba682964e6f9204f76590b6444d2d | |
parent | 1506027347776a2f6ec5b92d56ef192e85944e2e (diff) | |
download | gcc-f0f11559d569faffacea63db5c4a5ad98335c4ad.zip gcc-f0f11559d569faffacea63db5c4a5ad98335c4ad.tar.gz gcc-f0f11559d569faffacea63db5c4a5ad98335c4ad.tar.bz2 |
m68k: replace reload_in_progress by reload_in_progress || lra_in_progress
For now assume that LRA needs the same treatment as reload.
* config/m68k/m68k.md ("movsi", "movxf"): Replace
reload_in_progress by reload_in_progress || lra_in_progress.
* config/m68k/m68k.cc (m68k_legitimate_mem_p)
(emit_move_sequence): Likewise.
* config/m68k/predicates.md ("fp_src_operand"): Likewise.
-rw-r--r-- | gcc/config/m68k/m68k.cc | 21 | ||||
-rw-r--r-- | gcc/config/m68k/m68k.md | 9 | ||||
-rw-r--r-- | gcc/config/m68k/predicates.md | 1 |
3 files changed, 20 insertions, 11 deletions
diff --git a/gcc/config/m68k/m68k.cc b/gcc/config/m68k/m68k.cc index 7986e92..729a1e8 100644 --- a/gcc/config/m68k/m68k.cc +++ b/gcc/config/m68k/m68k.cc @@ -2352,7 +2352,8 @@ m68k_legitimate_mem_p (rtx x, struct m68k_address *address) { return (MEM_P (x) && m68k_decompose_address (GET_MODE (x), XEXP (x, 0), - reload_in_progress || reload_completed, + (reload_in_progress || lra_in_progress + || reload_completed), address)); } @@ -3899,11 +3900,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg) rtx tem; if (scratch_reg - && reload_in_progress && GET_CODE (operand0) == REG + && (reload_in_progress || lra_in_progress) + && GET_CODE (operand0) == REG && REGNO (operand0) >= FIRST_PSEUDO_REGISTER) operand0 = reg_equiv_mem (REGNO (operand0)); else if (scratch_reg - && reload_in_progress && GET_CODE (operand0) == SUBREG + && (reload_in_progress || lra_in_progress) + && GET_CODE (operand0) == SUBREG && GET_CODE (SUBREG_REG (operand0)) == REG && REGNO (SUBREG_REG (operand0)) >= FIRST_PSEUDO_REGISTER) { @@ -3916,11 +3919,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg) } if (scratch_reg - && reload_in_progress && GET_CODE (operand1) == REG + && (reload_in_progress || lra_in_progress) + && GET_CODE (operand1) == REG && REGNO (operand1) >= FIRST_PSEUDO_REGISTER) operand1 = reg_equiv_mem (REGNO (operand1)); else if (scratch_reg - && reload_in_progress && GET_CODE (operand1) == SUBREG + && (reload_in_progress || lra_in_progress) + && GET_CODE (operand1) == SUBREG && GET_CODE (SUBREG_REG (operand1)) == REG && REGNO (SUBREG_REG (operand1)) >= FIRST_PSEUDO_REGISTER) { @@ -3932,11 +3937,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg) operand1 = alter_subreg (&temp, true); } - if (scratch_reg && reload_in_progress && GET_CODE (operand0) == MEM + if (scratch_reg && (reload_in_progress || lra_in_progress) + && GET_CODE (operand0) == MEM && ((tem = find_replacement (&XEXP (operand0, 0))) != XEXP (operand0, 0))) operand0 = gen_rtx_MEM (GET_MODE (operand0), tem); - if (scratch_reg && reload_in_progress && GET_CODE (operand1) == MEM + if (scratch_reg && (reload_in_progress || lra_in_progress) + && GET_CODE (operand1) == MEM && ((tem = find_replacement (&XEXP (operand1, 0))) != XEXP (operand1, 0))) operand1 = gen_rtx_MEM (GET_MODE (operand1), tem); diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index e5c2528..1c9a6bf 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -957,11 +957,12 @@ /* The source is an address which requires PIC relocation. Call legitimize_pic_address with the source, mode, and a relocation register (a new pseudo, or the final destination if reload_in_progress - is set). Then fall through normally */ - rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode); + or lra_in_progress is set). Then fall through normally */ + rtx temp = ((reload_in_progress || lra_in_progress) + ? operands[0] : gen_reg_rtx (Pmode)); operands[1] = legitimize_pic_address (operands[1], SImode, temp); } - else if (flag_pic && TARGET_PCREL && ! reload_in_progress) + else if (flag_pic && TARGET_PCREL && ! (reload_in_progress || lra_in_progress)) { /* Don't allow writes to memory except via a register; the m68k doesn't consider PC-relative addresses to be writable. */ @@ -1452,7 +1453,7 @@ "" { /* We can't rewrite operands during reload. */ - if (! reload_in_progress) + if (! (reload_in_progress || lra_in_progress)) { if (CONSTANT_P (operands[1])) { diff --git a/gcc/config/m68k/predicates.md b/gcc/config/m68k/predicates.md index 46fc379..787e544 100644 --- a/gcc/config/m68k/predicates.md +++ b/gcc/config/m68k/predicates.md @@ -237,6 +237,7 @@ || (TARGET_68881 && (!standard_68881_constant_p (op) || reload_in_progress + || lra_in_progress || reload_completed))); }) |