summaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-08 09:12:56 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-08 09:12:56 +0000
commitf91737f9fef45f2e5204408aff79fb60013d1c94 (patch)
tree94762ce36d4d69dcdc1e3aed3dae7d3ab377a1e3 /gcc/ipa-prop.c
parent1ba3b2137bbdc8ef975d4d1a6ea3e0a3823b6e2e (diff)
downloadgcc-f91737f9fef45f2e5204408aff79fb60013d1c94.tar.gz
* tree-ssa-alias.c (walk_aliased_vdefs_1): Add FUNCTION_ENTRY_REACHED
parameter. (walk_aliased_vdefs): Likewise. * tree-ssa-alias.h (walk_aliased_vdefs): Likewise. * ipa-prop.c (stmt_may_be_vtbl_ptr_store): Skip clobbers (detect_type_change_from_memory_writes): Check if entry was reached. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212351 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 34e766d18f1..c6dd610fc5d 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -638,7 +638,8 @@ stmt_may_be_vtbl_ptr_store (gimple stmt)
{
if (is_gimple_call (stmt))
return false;
- /* TODO: Skip clobbers, doing so triggers problem in PR60306. */
+ if (gimple_clobber_p (stmt))
+ return false;
else if (is_gimple_assign (stmt))
{
tree lhs = gimple_assign_lhs (stmt);
@@ -817,6 +818,7 @@ detect_type_change_from_memory_writes (tree arg, tree base, tree comp_type,
{
struct type_change_info tci;
ao_ref ao;
+ bool entry_reached = false;
gcc_checking_assert (DECL_P (arg)
|| TREE_CODE (arg) == MEM_REF
@@ -847,13 +849,16 @@ detect_type_change_from_memory_writes (tree arg, tree base, tree comp_type,
tci.multiple_types_encountered = false;
walk_aliased_vdefs (&ao, gimple_vuse (call), check_stmt_for_type_change,
- &tci, NULL);
+ &tci, NULL, &entry_reached);
if (!tci.type_maybe_changed)
return false;
if (!tci.known_current_type
|| tci.multiple_types_encountered
- || offset != 0)
+ || offset != 0
+ /* When the walk reached function entry, it means that type
+ is set along some paths but not along others. */
+ || entry_reached)
jfunc->type = IPA_JF_UNKNOWN;
else
ipa_set_jf_known_type (jfunc, 0, tci.known_current_type, comp_type);