From fe6524b0e7659e243f2e13abf846477f0bf96456 Mon Sep 17 00:00:00 2001 From: law Date: Thu, 18 Nov 2010 14:34:29 +0000 Subject: PR middle-end-optimization/46297 * postreload.c (reload_combine_note_store): Deal with embedded side effects in MEM expressions. * gfortran.dg/pr46297.f: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166905 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/postreload.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gcc/postreload.c') diff --git a/gcc/postreload.c b/gcc/postreload.c index 1772c9e058d..6bbdf3adeff 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -1409,6 +1409,31 @@ reload_combine_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED) GET_MODE (dst)); dst = SUBREG_REG (dst); } + + /* Some targets do argument pushes without adding REG_INC notes. */ + + if (MEM_P (dst)) + { + dst = XEXP (dst, 0); + if (GET_CODE (dst) == PRE_INC || GET_CODE (dst) == POST_INC + || GET_CODE (dst) == PRE_DEC || GET_CODE (dst) == POST_DEC) + { + regno = REGNO (XEXP (dst, 0)); + mode = GET_MODE (XEXP (dst, 0)); + for (i = hard_regno_nregs[regno][mode] - 1 + regno; i >= regno; i--) + { + /* We could probably do better, but for now mark the register + as used in an unknown fashion and set/clobbered at this + insn. */ + reg_state[i].use_index = -1; + reg_state[i].store_ruid = reload_combine_ruid; + reg_state[i].real_store_ruid = reload_combine_ruid; + } + } + else + return; + } + if (!REG_P (dst)) return; regno += REGNO (dst); -- cgit v1.2.1