From 30984c5791c043900dbda277852231a3c4bb452c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 30 Mar 2002 19:50:34 +0100 Subject: [PATCH] re PR rtl-optimization/6086 (Reload misoptimizes DImode PREINC on PPC) PR optimization/6086 * combine.c (combine_simplify_rtx): If simplify_rtx failed because of SUBREG of volatile MEM or because the MEM was mode dependent, return CLOBBER instead of unmodified SUBREG. From-SVN: r51606 --- gcc/ChangeLog | 7 +++++++ gcc/combine.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a320e7a90fe7..3cfed7fd65eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-03-30 Jakub Jelinek + + PR optimization/6086 + * combine.c (combine_simplify_rtx): If simplify_rtx failed because + of SUBREG of volatile MEM or because the MEM was mode dependent, + return CLOBBER instead of unmodified SUBREG. + Sat Mar 30 14:08:55 CET 2002 Jan Hubicka * local-alloc.c (local_alloc): Avoid call of update_equiv_regs when not optimizing. diff --git a/gcc/combine.c b/gcc/combine.c index 3e97a1afddd0..de3bcefc0c58 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3875,6 +3875,13 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) return temp; } + /* Don't change the mode of the MEM if that would change the meaning + of the address. */ + if (GET_CODE (SUBREG_REG (x)) == MEM + && (MEM_VOLATILE_P (SUBREG_REG (x)) + || mode_dependent_address_p (XEXP (SUBREG_REG (x), 0)))) + return gen_rtx_CLOBBER (mode, const0_rtx); + /* Note that we cannot do any narrowing for non-constants since we might have been counting on using the fact that some bits were zero. We now do this in the SET. */ -- 2.43.5