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/combine.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/combine.c')
-rw-r--r-- | gcc/combine.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index bfa97b0..e34ab2f 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3715,7 +3715,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) /* If CODE is an associative operation not otherwise handled, see if we can associate some operands. This can win if they are constants or - if they are logically related (i.e. (a & b) & a. */ + if they are logically related (i.e. (a & b) & a). */ if ((code == PLUS || code == MINUS || code == MULT || code == AND || code == IOR || code == XOR || code == DIV || code == UDIV @@ -3774,7 +3774,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) /* simplify_subreg can't use gen_lowpart_for_combine. */ if (CONSTANT_P (SUBREG_REG (x)) - && subreg_lowpart_parts_p (mode, op0_mode, SUBREG_BYTE (x))) + && subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x)) return gen_lowpart_for_combine (mode, SUBREG_REG (x)); { @@ -9765,18 +9765,13 @@ gen_lowpart_for_combine (mode, x) else { int offset = 0; + rtx res; - if ((WORDS_BIG_ENDIAN || BYTES_BIG_ENDIAN) - && GET_MODE_SIZE (GET_MODE (x)) > GET_MODE_SIZE (mode)) - { - int difference = (GET_MODE_SIZE (GET_MODE (x)) - - GET_MODE_SIZE (mode)); - if (WORDS_BIG_ENDIAN) - offset += (difference / UNITS_PER_WORD) * UNITS_PER_WORD; - if (BYTES_BIG_ENDIAN) - offset += difference % UNITS_PER_WORD; - } - return gen_rtx_SUBREG (mode, x, offset); + offset = subreg_lowpart_offset (mode, GET_MODE (x)); + res = simplify_gen_subreg (mode, x, GET_MODE (x), offset); + if (res) + return res; + return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); } } |