diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2009-03-27 22:25:36 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2009-03-27 15:25:36 -0700 |
commit | c619e9823eb70134db45642968eb815bf270bd58 (patch) | |
tree | d0ee34c1b25d930f18a8d86229603462b5336bcc /gcc/jump.c | |
parent | 51212b321b1c143c36e54d68e9a29d1a1125f954 (diff) | |
download | gcc-c619e9823eb70134db45642968eb815bf270bd58.tar.gz |
jump.c (rtx_renumbered_equal_p): Use subreg_get_info.
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
* jump.c (rtx_renumbered_equal_p): Use subreg_get_info.
(true_regnum): Likewise.
* rtlanal.c (subreg_info): Moved to ...
* rtl.h (subreg_info): Here. New.
(subreg_get_info): New.
* rtlanal.c (subreg_get_info): Make it extern.
From-SVN: r145134
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index 2b9a9545223..1189f812fef 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1536,6 +1536,7 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y) { int reg_x = -1, reg_y = -1; int byte_x = 0, byte_y = 0; + struct subreg_info info; if (GET_MODE (x) != GET_MODE (y)) return 0; @@ -1552,15 +1553,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y) if (reg_renumber[reg_x] >= 0) { - if (!subreg_offset_representable_p (reg_renumber[reg_x], - GET_MODE (SUBREG_REG (x)), - byte_x, - GET_MODE (x))) + subreg_get_info (reg_renumber[reg_x], + GET_MODE (SUBREG_REG (x)), byte_x, + GET_MODE (x), &info); + if (!info.representable_p) return 0; - reg_x = subreg_regno_offset (reg_renumber[reg_x], - GET_MODE (SUBREG_REG (x)), - byte_x, - GET_MODE (x)); + reg_x = info.offset; byte_x = 0; } } @@ -1578,15 +1576,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y) if (reg_renumber[reg_y] >= 0) { - if (!subreg_offset_representable_p (reg_renumber[reg_y], - GET_MODE (SUBREG_REG (y)), - byte_y, - GET_MODE (y))) + subreg_get_info (reg_renumber[reg_y], + GET_MODE (SUBREG_REG (y)), byte_y, + GET_MODE (y), &info); + if (!info.representable_p) return 0; - reg_y = subreg_regno_offset (reg_renumber[reg_y], - GET_MODE (SUBREG_REG (y)), - byte_y, - GET_MODE (y)); + reg_y = info.offset; byte_y = 0; } } @@ -1728,13 +1723,17 @@ true_regnum (const_rtx x) { int base = true_regnum (SUBREG_REG (x)); if (base >= 0 - && base < FIRST_PSEUDO_REGISTER - && subreg_offset_representable_p (REGNO (SUBREG_REG (x)), - GET_MODE (SUBREG_REG (x)), - SUBREG_BYTE (x), GET_MODE (x))) - return base + subreg_regno_offset (REGNO (SUBREG_REG (x)), - GET_MODE (SUBREG_REG (x)), - SUBREG_BYTE (x), GET_MODE (x)); + && base < FIRST_PSEUDO_REGISTER) + { + struct subreg_info info; + + subreg_get_info (REGNO (SUBREG_REG (x)), + GET_MODE (SUBREG_REG (x)), + SUBREG_BYTE (x), GET_MODE (x), &info); + + if (info.representable_p) + return base + info.offset; + } } return -1; } |