* flow.c (insn_dead_p): Detect dead memory stores with auto increments.

From-SVN: r36220
This commit is contained in:
Herman A.J. ten Brugge 2000-09-07 03:22:07 +02:00 committed by Jeff Law
parent f725a3ec9b
commit 4f4b88d083
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2000-09-06 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* flow.c (insn_dead_p): Detect dead memory stores with auto increments.
2000-09-06 Kazu Hirata <kazu@hxi.com>
* calls.c: Fix formatting.

View File

@ -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);
}
}