From 3b5390853e05d0ea743bab74bac7bca1088bd98c Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 13 Mar 2003 20:59:40 +0000 Subject: * 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 --- gcc/ChangeLog.rewrite | 5 +++++ gcc/combine.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog.rewrite b/gcc/ChangeLog.rewrite index 2b3a7ce0c02..24b34179e4a 100644 --- a/gcc/ChangeLog.rewrite +++ b/gcc/ChangeLog.rewrite @@ -1,3 +1,8 @@ +2003-03-13 Richard Sandiford + + * 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 * config/mips/mips.c (mips_legitimize_symbol): Handle small data 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) -- cgit v1.2.3