aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlhooks.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2008-03-22 19:37:53 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2008-03-22 19:37:53 +0000
commit18b526e806ab64557cd575ff407fcb1da16ee8fd (patch)
treebb912a45ce2ff3b1666c9a26271e0833dc4b7c16 /gcc/rtlhooks.c
parent48e55066d5d0cd652b6527f08cb67768c4aaabe7 (diff)
downloadgcc-18b526e806ab64557cd575ff407fcb1da16ee8fd.zip
gcc-18b526e806ab64557cd575ff407fcb1da16ee8fd.tar.gz
gcc-18b526e806ab64557cd575ff407fcb1da16ee8fd.tar.bz2
re PR rtl-optimization/33927 (replace_read in dse.c could handle cases where GET_MODE_CLASS (read_mode) != GET_MODE_CLASS (store_mode) (and the size is the same))
gcc/ PR rtl-optimization/33927 * Makefile.in (dse.o): Depend on $(TM_P_H). * expr.h (extract_low_bits): Declare. * expmed.c (extract_low_bits): New function. * rtlhooks.c (gen_lowpart_general): Generalize SUBREG handling. * dse.c: Include tm_p.h. (find_shift_sequence): Remove the read_reg argument and return the read value. Emit the instructions instead of returning them. Iterate on new_mode rather than calculating it each time. Check MODES_TIEABLE_P. Use simplify_gen_subreg to convert the source to NEW_MODE and extract_low_bits to convert the shifted value to READ_MODE. (replace_read): Allow the load and store to have different mode classes. Use extract_low_bits when SHIFT == 0. Create the shift or extraction instructions before trying the replacement. Update dump-file code accordingly, avoiding use of REGNO (store_info->rhs). gcc/testsuite/ * gcc.target/mips/dse-1.c: Add checks for zeros. From-SVN: r133452
Diffstat (limited to 'gcc/rtlhooks.c')
-rw-r--r--gcc/rtlhooks.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/rtlhooks.c b/gcc/rtlhooks.c
index 8939b21..432b286 100644
--- a/gcc/rtlhooks.c
+++ b/gcc/rtlhooks.c
@@ -43,11 +43,9 @@ gen_lowpart_general (enum machine_mode mode, rtx x)
if (result)
return result;
- /* If it's a REG, it must be a hard reg that's not valid in MODE. */
- else if (REG_P (x)
- /* Or we could have a subreg of a floating point value. */
- || (GET_CODE (x) == SUBREG
- && FLOAT_MODE_P (GET_MODE (SUBREG_REG (x)))))
+ /* Handle SUBREGs and hard REGs that were rejected by
+ simplify_gen_subreg. */
+ else if (REG_P (x) || GET_CODE (x) == SUBREG)
{
result = gen_lowpart_common (mode, copy_to_reg (x));
gcc_assert (result != 0);