diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2003-03-13 20:59:40 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@redhat.com> | 2003-03-13 20:59:40 +0000 |
commit | 3b5390853e05d0ea743bab74bac7bca1088bd98c (patch) | |
tree | 7288c3b5110a9edeb848c080aeb9796313f075b5 | |
parent | 0b11e5c39aa3e220d86bede98f0fc9754ae9e787 (diff) |
* combine.c (gen_lowpart_for_combine): Treat the lowpart Pmode of
a CONST as identity. Check the return value of gen_lowpart_common.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/mips-3_4-rewrite-branch@64329 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.rewrite | 5 | ||||
-rw-r--r-- | gcc/combine.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog.rewrite b/gcc/ChangeLog.rewrite index 2b3a7ce0c02..24b34179e4a 100644 --- a/gcc/ChangeLog.rewrite +++ b/gcc/ChangeLog.rewrite @@ -1,5 +1,10 @@ 2003-03-13 Richard Sandiford <rsandifo@redhat.com> + * combine.c (gen_lowpart_for_combine): Treat the lowpart Pmode of + a CONST as identity. Check the return value of gen_lowpart_common. + +2003-03-13 Richard Sandiford <rsandifo@redhat.com> + * config/mips/mips.c (mips_legitimize_symbol): Handle small data references for TARGET_EXPLICIT_RELOCS. (mips_reloc_string): Return "%gp_rel(" for RELOC_GPREL16 if diff --git a/gcc/combine.c b/gcc/combine.c index 0828b659374..c388f1c22c4 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -9958,6 +9958,11 @@ gen_lowpart_for_combine (mode, x) if (GET_MODE (x) == mode) return x; + /* CONSTs don't have modes, but the lowpart Pmode of an assembly + constant is itself. */ + if (mode == Pmode && GET_CODE (x) == CONST) + return x; + /* We can only support MODE being wider than a word if X is a constant integer or has a mode the same size. */ @@ -10040,6 +10045,8 @@ gen_lowpart_for_combine (mode, x) { sub_mode = int_mode_for_mode (mode); x = gen_lowpart_common (sub_mode, x); + if (x == 0) + return gen_rtx_CLOBBER (VOIDmode, const0_rtx); } res = simplify_gen_subreg (mode, x, sub_mode, offset); if (res) |