diff options
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index 2b111d4bd59..5c5807394dc 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -3543,7 +3543,7 @@ rtx_renumbered_equal_p (x, y) && GET_CODE (SUBREG_REG (y)) == REG))) { int reg_x = -1, reg_y = -1; - int word_x = 0, word_y = 0; + int byte_x = 0, byte_y = 0; if (GET_MODE (x) != GET_MODE (y)) return 0; @@ -3556,15 +3556,17 @@ rtx_renumbered_equal_p (x, y) if (code == SUBREG) { reg_x = REGNO (SUBREG_REG (x)); - word_x = SUBREG_WORD (x); + byte_x = SUBREG_BYTE (x); if (reg_renumber[reg_x] >= 0) { - reg_x = reg_renumber[reg_x] + word_x; - word_x = 0; + reg_x = subreg_regno_offset (reg_renumber[reg_x], + GET_MODE (SUBREG_REG (x)), + byte_x, + GET_MODE (x)); + byte_x = 0; } } - else { reg_x = REGNO (x); @@ -3575,15 +3577,17 @@ rtx_renumbered_equal_p (x, y) if (GET_CODE (y) == SUBREG) { reg_y = REGNO (SUBREG_REG (y)); - word_y = SUBREG_WORD (y); + byte_y = SUBREG_BYTE (y); if (reg_renumber[reg_y] >= 0) { - reg_y = reg_renumber[reg_y]; - word_y = 0; + reg_y = subreg_regno_offset (reg_renumber[reg_y], + GET_MODE (SUBREG_REG (y)), + byte_y, + GET_MODE (y)); + byte_y = 0; } } - else { reg_y = REGNO (y); @@ -3591,7 +3595,7 @@ rtx_renumbered_equal_p (x, y) reg_y = reg_renumber[reg_y]; } - return reg_x >= 0 && reg_x == reg_y && word_x == word_y; + return reg_x >= 0 && reg_x == reg_y && byte_x == byte_y; } /* Now we have disposed of all the cases @@ -3722,7 +3726,9 @@ true_regnum (x) { int base = true_regnum (SUBREG_REG (x)); if (base >= 0 && base < FIRST_PSEUDO_REGISTER) - return SUBREG_WORD (x) + base; + return base + subreg_regno_offset (REGNO (SUBREG_REG (x)), + GET_MODE (SUBREG_REG (x)), + SUBREG_BYTE (x), GET_MODE (x)); } return -1; } |