From c716ac28cdbd4737f4319663ab60e22bf3affde2 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 20 Jan 2016 08:36:32 +0000 Subject: [PATCH] 2016-01-20 Richard Biener PR tree-optimization/69345 * tree-ssa-sccvn.h (VN_INFO_RANGE_INFO): New inline function. (VN_INFO_PTR_INFO): Likewise. * tree-ssa-sccvn.c (set_ssa_val_to): Avoid clearing points-to info when it is equal between non-dominating SSA names. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Make sure to look at original SSA infos. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232603 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 10 ++++++++++ gcc/tree-ssa-pre.c | 14 +++++++------- gcc/tree-ssa-sccvn.c | 6 +++++- gcc/tree-ssa-sccvn.h | 20 ++++++++++++++++++++ 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 53096804195..d6750386785 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2016-01-20 Richard Biener + + PR tree-optimization/69345 + * tree-ssa-sccvn.h (VN_INFO_RANGE_INFO): New inline function. + (VN_INFO_PTR_INFO): Likewise. + * tree-ssa-sccvn.c (set_ssa_val_to): Avoid clearing points-to + info when it is equal between non-dominating SSA names. + * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): + Make sure to look at original SSA infos. + 2016-01-20 Jeff Law PR target/25114 diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 1f1b0559d08..311663d80a2 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -4033,22 +4033,22 @@ eliminate_dom_walker::before_dom_children (basic_block b) { basic_block sprime_b = gimple_bb (SSA_NAME_DEF_STMT (sprime)); if (POINTER_TYPE_P (TREE_TYPE (lhs)) - && SSA_NAME_PTR_INFO (lhs) - && !SSA_NAME_PTR_INFO (sprime)) + && VN_INFO_PTR_INFO (lhs) + && ! VN_INFO_PTR_INFO (sprime)) { duplicate_ssa_name_ptr_info (sprime, - SSA_NAME_PTR_INFO (lhs)); + VN_INFO_PTR_INFO (lhs)); if (b != sprime_b) mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (sprime)); } - else if (!POINTER_TYPE_P (TREE_TYPE (lhs)) - && SSA_NAME_RANGE_INFO (lhs) - && !SSA_NAME_RANGE_INFO (sprime) + else if (INTEGRAL_TYPE_P (TREE_TYPE (lhs)) + && VN_INFO_RANGE_INFO (lhs) + && ! VN_INFO_RANGE_INFO (sprime) && b == sprime_b) duplicate_ssa_name_range_info (sprime, SSA_NAME_RANGE_TYPE (lhs), - SSA_NAME_RANGE_INFO (lhs)); + VN_INFO_RANGE_INFO (lhs)); } /* Inhibit the use of an inserted PHI on a loop header when diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index a6ee501892b..e7bac420dbb 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -3092,7 +3092,11 @@ set_ssa_val_to (tree from, tree to) /* Use that from the dominator. */ SSA_NAME_PTR_INFO (to) = SSA_NAME_PTR_INFO (from); } - else + else if (! SSA_NAME_PTR_INFO (from) + /* Handle the case of trivially equivalent info. */ + || memcmp (SSA_NAME_PTR_INFO (to), + SSA_NAME_PTR_INFO (from), + sizeof (ptr_info_def)) != 0) { /* Save old info. */ if (! VN_INFO (to)->info.ptr_info) diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h index d94bc1c0950..14093ddca44 100644 --- a/gcc/tree-ssa-sccvn.h +++ b/gcc/tree-ssa-sccvn.h @@ -243,4 +243,24 @@ vn_valueize (tree name) return name; } +/* Get at the original range info for NAME. */ + +inline range_info_def * +VN_INFO_RANGE_INFO (tree name) +{ + return (VN_INFO (name)->info.range_info + ? VN_INFO (name)->info.range_info + : SSA_NAME_RANGE_INFO (name)); +} + +/* Get at the original pointer info for NAME. */ + +inline ptr_info_def * +VN_INFO_PTR_INFO (tree name) +{ + return (VN_INFO (name)->info.ptr_info + ? VN_INFO (name)->info.ptr_info + : SSA_NAME_PTR_INFO (name)); +} + #endif /* TREE_SSA_SCCVN_H */ -- 2.11.4.GIT