* [PATCH] Fix PR8967
@ 2002-12-21 15:41 Zdenek Dvorak
0 siblings, 0 replies; only message in thread
From: Zdenek Dvorak @ 2002-12-21 15:41 UTC (permalink / raw)
To: gcc; +Cc: gcc-patches, jh, martin, dann
Hello,
the patch below should fix the problem. I am not quite sure about its
correctness -- there indeed should be anti_dependence in mark_used_regs,
but it does not handle the pretended set of unchanging mem after its
use. I would be much happier if there were some cleaner way.
Zdenek
Changelog:
* flow.c (init_propagate_block_info, insn_dead_p, mark_used_regs):
Eliminate dead unchanging mem stores.
*** flow.c Fri Dec 20 18:59:43 2002
--- /mnt/extra/gcc_main_rtlopt_merge/gcc/gcc/flow.c Sat Dec 21 16:38:42 2002
*************** init_propagate_block_info (bb, live, loc
*** 1996,2008 ****
rtx mem = SET_DEST (set);
rtx canon_mem = canon_rtx (mem);
- /* This optimization is performed by faking a store to the
- memory at the end of the block. This doesn't work for
- unchanging memories because multiple stores to unchanging
- memory is illegal and alias analysis doesn't consider it. */
- if (RTX_UNCHANGING_P (canon_mem))
- continue;
-
if (XEXP (canon_mem, 0) == frame_pointer_rtx
|| (GET_CODE (XEXP (canon_mem, 0)) == PLUS
&& XEXP (XEXP (canon_mem, 0), 0) == frame_pointer_rtx
--- 1997,2002 ----
*************** insn_dead_p (pbi, x, call_ok, notes)
*** 2177,2185 ****
If so, this memory write is dead (remember, we're walking
backwards from the end of the block to the start). Since
rtx_equal_p does not check the alias set or flags, we also
! must have the potential for them to conflict (anti_dependence). */
for (temp = pbi->mem_set_list; temp != 0; temp = XEXP (temp, 1))
! if (anti_dependence (r, XEXP (temp, 0)))
{
rtx mem = XEXP (temp, 0);
--- 2171,2179 ----
If so, this memory write is dead (remember, we're walking
backwards from the end of the block to the start). Since
rtx_equal_p does not check the alias set or flags, we also
! must have the potential for them to conflict (output_dependence). */
for (temp = pbi->mem_set_list; temp != 0; temp = XEXP (temp, 1))
! if (output_dependence (r, XEXP (temp, 0)))
{
rtx mem = XEXP (temp, 0);
*************** mark_used_regs (pbi, x, cond, insn)
*** 3791,3798 ****
while (temp)
{
next = XEXP (temp, 1);
! if (anti_dependence (XEXP (temp, 0), x))
{
/* Splice temp out of the list. */
if (prev)
--- 3785,3794 ----
while (temp)
{
+ rtx mem = XEXP (temp, 0);
next = XEXP (temp, 1);
! if (true_dependence (mem, GET_MODE (mem), x,
! rtx_addr_varies_p))
{
/* Splice temp out of the list. */
if (prev)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-12-21 18:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-21 15:41 [PATCH] Fix PR8967 Zdenek Dvorak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).