RISC-V: Fix riscv_subword() for big endian
gcc/ * config/riscv/riscv.c (riscv_subword): Take endianness into account when calculating the byte offset.
This commit is contained in:
parent
7ac4dfec39
commit
fffefe3d9d
1 changed files with 1 additions and 1 deletions
|
@ -1966,7 +1966,7 @@ riscv_address_cost (rtx addr, machine_mode mode,
|
|||
rtx
|
||||
riscv_subword (rtx op, bool high_p)
|
||||
{
|
||||
unsigned int byte = high_p ? UNITS_PER_WORD : 0;
|
||||
unsigned int byte = (high_p != BYTES_BIG_ENDIAN) ? UNITS_PER_WORD : 0;
|
||||
machine_mode mode = GET_MODE (op);
|
||||
|
||||
if (mode == VOIDmode)
|
||||
|
|
Loading…
Add table
Reference in a new issue