* [PATCH][mem-ref] Fix DSE with pointers
@ 2008-03-09 17:56 Richard Guenther
0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2008-03-09 17:56 UTC (permalink / raw)
To: gcc-patches
Bootstrapped and "tested" on x86_64-unknown-linux-gnu, applied to the
branch.
2008-03-09 Richard Guenther <rguenther@suse.de>
* tree-ssa-dse.c (dse_possible_dead_store_p): Handle
INDIRECT_MEM_REF.
Index: mem-ref/gcc/tree-ssa-dse.c
===================================================================
*** mem-ref.orig/gcc/tree-ssa-dse.c 2008-03-09 16:20:42.000000000 +0100
--- mem-ref/gcc/tree-ssa-dse.c 2008-03-09 16:24:43.000000000 +0100
*************** dse_possible_dead_store_p (tree stmt,
*** 325,335 ****
if (TREE_CODE (temp) == GIMPLE_MODIFY_STMT)
{
tree base1 = get_base_address (GIMPLE_STMT_OPERAND (stmt, 0));
! tree base2 = get_base_address (GIMPLE_STMT_OPERAND (temp, 0));
! while (base1 && INDIRECT_REF_P (base1))
base1 = TREE_OPERAND (base1, 0);
! while (base2 && INDIRECT_REF_P (base2))
base2 = TREE_OPERAND (base2, 0);
if (base1 != base2)
--- 325,339 ----
if (TREE_CODE (temp) == GIMPLE_MODIFY_STMT)
{
tree base1 = get_base_address (GIMPLE_STMT_OPERAND (stmt, 0));
! tree base2 = get_base_address (GIMPLE_STMT_OPERAND (temp, 0));
! while (base1
! && (INDIRECT_REF_P (base1)
! || TREE_CODE (base1) == INDIRECT_MEM_REF))
base1 = TREE_OPERAND (base1, 0);
! while (base2
! && (INDIRECT_REF_P (base2)
! || TREE_CODE (base2) == INDIRECT_MEM_REF))
base2 = TREE_OPERAND (base2, 0);
if (base1 != base2)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-09 17:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-09 17:56 [PATCH][mem-ref] Fix DSE with pointers Richard Guenther
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).