From: Herman A.J. ten Brugge Date: Thu, 7 Sep 2000 01:22:07 +0000 (+0200) Subject: * flow.c (insn_dead_p): Detect dead memory stores with auto increments. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f4b88d0832c7279722b5dee73d9ce9f1704452f;p=platform%2Fupstream%2Fgcc.git * flow.c (insn_dead_p): Detect dead memory stores with auto increments. From-SVN: r36220 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f21bd1a..0214e8d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2000-09-06 Herman A.J. ten Brugge + + * flow.c (insn_dead_p): Detect dead memory stores with auto increments. + 2000-09-06 Kazu Hirata * calls.c: Fix formatting. diff --git a/gcc/flow.c b/gcc/flow.c index 6f1ba7c..ca6cac2 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -3954,8 +3954,21 @@ insn_dead_p (pbi, x, call_ok, notes) temp = pbi->mem_set_list; while (temp) { - if (rtx_equal_p (XEXP (temp, 0), r)) + rtx mem = XEXP (temp, 0); + + if (rtx_equal_p (mem, r)) + return 1; +#ifdef AUTO_INC_DEC + /* Check if memory reference matches an auto increment. Only + post increment/decrement or modify are valid. */ + if (GET_MODE (mem) == GET_MODE (r) + && (GET_CODE (XEXP (mem, 0)) == POST_DEC + || GET_CODE (XEXP (mem, 0)) == POST_INC + || GET_CODE (XEXP (mem, 0)) == POST_MODIFY) + && GET_MODE (XEXP (mem, 0)) == GET_MODE (r) + && rtx_equal_p (XEXP (XEXP (mem, 0), 0), XEXP (r, 0))) return 1; +#endif temp = XEXP (temp, 1); } }