diff options
author | Jan Hubicka <jh@suse.cz> | 2001-06-04 16:52:14 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-06-04 14:52:14 +0000 |
commit | e0e08ac26c828bca4b9323d3139eba9293f3ecf4 (patch) | |
tree | d351d9b0c5c56ead3c8dc57fbda5329e9a5df46f /gcc/rtlanal.c | |
parent | 95307c8e0167e5460471eecb7056913b63d6043a (diff) | |
download | gcc-e0e08ac26c828bca4b9323d3139eba9293f3ecf4.zip gcc-e0e08ac26c828bca4b9323d3139eba9293f3ecf4.tar.gz gcc-e0e08ac26c828bca4b9323d3139eba9293f3ecf4.tar.bz2 |
simplify_rtx.c (simplify_subreg): Keep subregs on return values...
* simplify_rtx.c (simplify_subreg): Keep subregs on return values,
check CLASS_CANNOT_CHANGE_MODE before avoiding subreg on hard reg,
in case register wasn't OK previously, accept it now; allow
subregs of frame pointer if reload completed and frame pointer
is not needed.
* combine.c (sombine_simplify_rtx): Fix comment;
use subreg_lowpart_offset instead of subreg_lowpart_p
(gen_lowpart_for_combine): Use subreg_lowpart_offset.
* rtl.h (subreg_lowpart_parts_p): Kill.
(subreg_lowpart_offset, subreg_highpart_offset): Declare.
* simplify-rtx.c (simplify_subreg): Use subreg_lowpart_offset.
* emit-rtl.c (gen_lowpart_SUBREG): Use subreg_lowpart_offset;
(gen_lowpart_common): Likewise.
(subreg_lowpart_p): Likewise.
(subreg_lowpart_parts_p): Kill.
(subreg_lowpart_offset, subreg_highpart_offset): New function.
* emit-rtl.c (gen_lowpart_common): Use simplify_gen_subreg
to simplify SUBREG and REG.
(gen_highpart): Use simplify_gen_subreg for all simplifications.
* emit-rtl.c (gen_realpart, gen_imagpart): Do not handle
CONCAT specially.
* rtlanal.c (replace_regs): Use simplify_gen_subreg
From-SVN: r42850
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index af0f81f..0f0f6cd 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2258,40 +2258,9 @@ replace_regs (x, reg_map, nregs, replace_dest) && GET_CODE (reg_map[REGNO (SUBREG_REG (x))]) == SUBREG) { rtx map_val = reg_map[REGNO (SUBREG_REG (x))]; - rtx map_inner = SUBREG_REG (map_val); - - if (GET_MODE (x) == GET_MODE (map_inner)) - return map_inner; - else - { - int final_offset = SUBREG_BYTE (x) + SUBREG_BYTE (map_val); - - /* When working with REG SUBREGs the rule is that the byte - offset must be a multiple of the SUBREG's mode. */ - final_offset = (final_offset / GET_MODE_SIZE (GET_MODE (x))); - final_offset = (final_offset * GET_MODE_SIZE (GET_MODE (x))); - - /* We cannot call gen_rtx here since we may be linked with - genattrtab.c. */ - /* Let's try clobbering the incoming SUBREG and see - if this is really safe. */ - SUBREG_REG (x) = map_inner; - SUBREG_BYTE (x) = final_offset; - return x; -#if 0 - rtx new = rtx_alloc (SUBREG); - int final_offset = SUBREG_BYTE (x) + SUBREG_BYTE (map_val); - - /* When working with REG SUBREGs the rule is that the byte - offset must be a multiple of the SUBREG's mode. */ - final_offset = (final_offset / GET_MODE_SIZE (GET_MODE (x))); - final_offset = (final_offset * GET_MODE_SIZE (GET_MODE (x))); - - PUT_MODE (new, GET_MODE (x)); - SUBREG_REG (new) = map_inner; - SUBREG_BYTE (new) = final_offset; -#endif - } + return simplify_gen_subreg (GET_MODE (x), map_val, + GET_MODE (SUBREG_REG (x)), + SUBREG_BYTE (x)); } break; |