View | Details | Return to bug 97417 | Differences between
and this patch

Collapse All | Expand All

(-)a/riscv-gcc/gcc/config/riscv/riscv.c (+22 lines)
Lines 1528-1533 riscv_legitimize_const_move (machine_mode mode, rtx dest, rtx src) Link Here
1528
bool
1528
bool
1529
riscv_legitimize_move (machine_mode mode, rtx dest, rtx src)
1529
riscv_legitimize_move (machine_mode mode, rtx dest, rtx src)
1530
{
1530
{
1531
  /* Expand 
1532
      (set (reg:QI target) (mem:QI (address))) 
1533
        to
1534
      (set (reg:DI temp) (zero_extend:DI (mem:DI (address))))
1535
      (set (reg:QI target) (subreg:QI (reg:DI temp) 0))
1536
    with auto-sign/zero extend.  */
1537
1538
  if (GET_MODE_CLASS (mode) == MODE_INT
1539
        && GET_MODE_SIZE (mode) < UNITS_PER_WORD
1540
        && can_create_pseudo_p()
1541
        && MEM_P (src))
1542
    {
1543
      rtx temp_reg;
1544
      int zero_sign_extend;
1545
1546
      temp_reg = gen_reg_rtx (word_mode);
1547
      zero_sign_extend = (LOAD_EXTEND_OP (mode) == ZERO_EXTEND);
1548
      emit_insn (gen_extend_insn(temp_reg, src, word_mode, mode, zero_sign_extend));
1549
      riscv_emit_move (dest, gen_lowpart(mode, temp_reg));
1550
      return true;
1551
    }
1552
1531
  if (!register_operand (dest, mode) && !reg_or_0_operand (src, mode))
1553
  if (!register_operand (dest, mode) && !reg_or_0_operand (src, mode))
1532
    {
1554
    {
1533
      rtx reg;
1555
      rtx reg;

Return to bug 97417