diff options
author | Richard Biener <rguenther@suse.de> | 2012-12-17 14:55:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-12-17 14:55:53 +0000 |
commit | ef7a9fb869cbaa03880946613b63e4dbe611470c (patch) | |
tree | c13fb20ea4bbddf5565973cd7b0caace2b987580 /gcc | |
parent | 3b3572643d2dc3b94e90fa2f3eada2def470ffd1 (diff) | |
download | gcc-ef7a9fb869cbaa03880946613b63e4dbe611470c.zip gcc-ef7a9fb869cbaa03880946613b63e4dbe611470c.tar.gz gcc-ef7a9fb869cbaa03880946613b63e4dbe611470c.tar.bz2 |
re PR target/54781 (ICE in refs_may_alias_p_1, at tree-ssa-alias.c:1124)
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.
From-SVN: r194554
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/alias.c | 37 |
2 files changed, 15 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6784783..47f5a01 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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. + 2012-12-17 James Greenhalgh <james.greenhalgh@arm.com> Tejas Belagod <tejas.belagod@arm.com> diff --git a/gcc/alias.c b/gcc/alias.c index 130c1a4..5fa3424 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); |