summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-17 14:55:53 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-17 14:55:53 +0000
commit9bbb37b8fcab3b35f9e5c26c5802d5961ca3538c (patch)
treec13fb20ea4bbddf5565973cd7b0caace2b987580 /gcc/alias.c
parentb9ed229934a154a9cfc96cae4bd27303329d1779 (diff)
downloadgcc-9bbb37b8fcab3b35f9e5c26c5802d5961ca3538c.tar.gz
2012-12-17 Richard Biener <rguenther@suse.de>
PR middle-end/54781 * alias.c (ao_ref_from_mem): More appropriately constrain the base object we feed to the tree oracle. Remove dead code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194554 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 130c1a4950b..5fa34249ecd 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -283,27 +283,20 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
if (base == NULL_TREE)
return false;
- /* The tree oracle doesn't like to have these. */
- if (TREE_CODE (base) == FUNCTION_DECL
- || TREE_CODE (base) == LABEL_DECL)
- return false;
-
- /* If this is a pointer dereference of a non-SSA_NAME punt.
- ??? We could replace it with a pointer to anything. */
- if ((INDIRECT_REF_P (base)
- || TREE_CODE (base) == MEM_REF)
- && TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME)
- return false;
- if (TREE_CODE (base) == TARGET_MEM_REF
- && TMR_BASE (base)
- && TREE_CODE (TMR_BASE (base)) != SSA_NAME)
+ /* The tree oracle doesn't like bases that are neither decls
+ nor indirect references of SSA names. */
+ if (!(DECL_P (base)
+ || (TREE_CODE (base) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME)
+ || (TREE_CODE (base) == TARGET_MEM_REF
+ && TREE_CODE (TMR_BASE (base)) == SSA_NAME)))
return false;
/* If this is a reference based on a partitioned decl replace the
- base with an INDIRECT_REF of the pointer representative we
+ base with a MEM_REF of the pointer representative we
created during stack slot partitioning. */
if (TREE_CODE (base) == VAR_DECL
- && ! TREE_STATIC (base)
+ && ! is_global_var (base)
&& cfun->gimple_df->decls_to_pointers != NULL)
{
void *namep;
@@ -311,18 +304,6 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
if (namep)
ref->base = build_simple_mem_ref (*(tree *)namep);
}
- else if (TREE_CODE (base) == TARGET_MEM_REF
- && TREE_CODE (TMR_BASE (base)) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (TMR_BASE (base), 0)) == VAR_DECL
- && ! TREE_STATIC (TREE_OPERAND (TMR_BASE (base), 0))
- && cfun->gimple_df->decls_to_pointers != NULL)
- {
- void *namep;
- namep = pointer_map_contains (cfun->gimple_df->decls_to_pointers,
- TREE_OPERAND (TMR_BASE (base), 0));
- if (namep)
- ref->base = build_simple_mem_ref (*(tree *)namep);
- }
ref->ref_alias_set = MEM_ALIAS_SET (mem);